prevent js crash if responseJSON is undefined

This commit is contained in:
barisusakli
2015-01-16 23:52:51 -05:00
parent 236fe91e95
commit b333653464

View File

@@ -49,7 +49,7 @@ define('uploader', ['csrf'], function(csrf) {
}, },
error: function(xhr) { error: function(xhr) {
xhr = maybeParse(xhr); xhr = maybeParse(xhr);
showAlert('error', xhr.responseJSON.error); showAlert('error', xhr.responseJSON ? xhr.responseJSON.error : 'error uploading, code : ' + xhr.status);
}, },
uploadProgress: function(event, position, total, percent) { uploadProgress: function(event, position, total, percent) {