summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <theephil@gmail.com>2015-03-26 21:08:17 +0000
committerPhil Hughes <theephil@gmail.com>2015-03-26 21:08:17 +0000
commit1989b66734bac2b9db38512a0a32b8af98d6f69f (patch)
tree0fa5a0db95f9784cc0103d6c9212787d3b0a9e3a /app
parent090f2344ecb6631b20df5853045536f1eb0589d3 (diff)
downloadgitlab-ce-1989b66734bac2b9db38512a0a32b8af98d6f69f.tar.gz
Fixed JS issue with diff image loading
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/commit/image-file.js.coffee9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/commit/image-file.js.coffee b/app/assets/javascripts/commit/image-file.js.coffee
index 9e5f49b1f69..9c723f51e54 100644
--- a/app/assets/javascripts/commit/image-file.js.coffee
+++ b/app/assets/javascripts/commit/image-file.js.coffee
@@ -119,8 +119,9 @@ class @ImageFile
requestImageInfo: (img, callback) ->
domImg = img.get(0)
- if domImg.complete
- callback.call(this, domImg.naturalWidth, domImg.naturalHeight)
- else
- img.on 'load', =>
+ if domImg
+ if domImg.complete
callback.call(this, domImg.naturalWidth, domImg.naturalHeight)
+ else
+ img.on 'load', =>
+ callback.call(this, domImg.naturalWidth, domImg.naturalHeight)