]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: storage: handle empty response in case of file upload error
authorTim Marx <t.marx@proxmox.com>
Tue, 7 May 2019 11:46:03 +0000 (13:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 7 May 2019 12:03:31 +0000 (12:03 +0000)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
www/manager6/storage/ContentView.js

index b7615b22729c515524b0398052130885809345b7..907521cb71c6bc7eee08223c075d046dbfde7cda 100644 (file)
@@ -290,13 +290,18 @@ Ext.define('PVE.storage.Upload', {
                        me.close();
                    } else {
                        var msg = gettext('Error') + " " + xhr.status.toString() + ": " + Ext.htmlEncode(xhr.statusText);
-                       var result = Ext.decode(xhr.responseText);
-                       result.message = msg;
-                       var htmlStatus = Proxmox.Utils.extractRequestError(result, true);
-                       Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
-                           me.close();
-                       });
-
+                       if (xhr.responseText !== "") {
+                           var result = Ext.decode(xhr.responseText);
+                           result.message = msg;
+                           var htmlStatus = Proxmox.Utils.extractRequestError(result, true);
+                           Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
+                               me.close();
+                           });
+                       } else {
+                           Ext.Msg.alert(gettext('Error'), msg, function(btn) {
+                               me.close();
+                           });
+                       }
                    }
                }, false);