U4-8407 - Javascript error when picked media has no file

Created by Murray Roke 03 May 2016, 23:52:54 Updated by Arnold Visser 10 May 2016, 08:30:58

Create a media item in the media library with an image file Pick media item on a content node. Remove file from media item. Open content node to edit Then you get a javascript error and cannot edit the picked image.

angular.min.js?cdv=902113107:63 TypeError: Cannot read property 'src' of null
    at Object.Umbraco.ImageCropper (umbraco.controllers.js?cdv=902113107:6745)
    at Object.resolveFileFromEntity (umbraco.services.js?cdv=902113107:3494)
    at umbraco.controllers.js?cdv=902113107:7692
    at Function.h.each.h.forEach (underscore.js:103)
    at umbraco.controllers.js?cdv=902113107:7686
    at i (angular.min.js?cdv=902113107:79)
    at angular.min.js?cdv=902113107:80
    at Object.e.$eval (angular.min.js?cdv=902113107:92)
    at Object.e.$digest (angular.min.js?cdv=902113107:90)
    at Object.e.$apply (angular.min.js?cdv=902113107:92)

Work-around: edit the media item to include an image


Arnold Visser 10 May 2016, 08:30:58


You could apply a nullcheck to fix this here:


change: if (val.PropertyEditorAlias === resolver) to: if (val.PropertyEditorAlias === resolver && val.Value != null) {

But although I would love to create the pull request for this, I am not really sure this is really the right location for this issue and it might have to be fixed somewhere else instead.

Priority: Normal

Type: Bug

State: Submitted


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.8, 7.4.3

Due in version:


Story Points: