summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-21 15:11:09 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-21 15:11:09 +0000
commit9bd6c41a026c8f736f1238d326dd8b073e8de827 (patch)
tree00c6d5e6b19949214f9db197b9db07e5142f60f4 /app
parent7e51ec4f04d6512a70aa59fe10a176b8455fff76 (diff)
parent1989b66734bac2b9db38512a0a32b8af98d6f69f (diff)
downloadgitlab-ce-9bd6c41a026c8f736f1238d326dd8b073e8de827.tar.gz
Merge branch 'commit-image-branch' into 'master'
Fixed JS issue with diff image loading Fixes #1323 Whilst I couldn't reproduce the error locally, I did manage to get the same JS error message that was in the live env. See merge request !463
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)