浏览代码

HUE-3172 [fb] Canceling a dropped file from Desktop causes a JS error

Enrico Berti 9 年之前
父节点
当前提交
8d315c05c4
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako

+ 5 - 3
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -1643,9 +1643,11 @@ from django.utils.translation import ugettext as _
               $.jHueNotify.info("${_('Upload has been canceled')}");
               $.jHueNotify.info("${_('Upload has been canceled')}");
             },
             },
             complete: function (data) {
             complete: function (data) {
-              var response = JSON.parse(data.xhr.response);
-              if (response && response.status && response.status == -1){
-                $.jHueNotify.error(response.data);
+              if (data.xhr.response != '') {
+                var response = JSON.parse(data.xhr.response);
+                if (response && response.status && response.status == -1) {
+                  $.jHueNotify.error(response.data);
+                }
               }
               }
             }
             }
           };
           };