Эх сурвалжийг харах

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

Enrico Berti 9 жил өмнө
parent
commit
8d315c0

+ 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')}");
             },
             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);
+                }
               }
             }
           };