]> git.proxmox.com Git - pve-manager.git/commitdiff
ui snapshot tree: avoid another exception in delayd load when view is gone
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Jan 2020 19:03:23 +0000 (20:03 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Jan 2020 19:06:16 +0000 (20:06 +0100)
similar story than commit 9cc4958f5a03dd130198a090472782a2664d5b8d
We cannot really assert anything about the state of me (the view) and
consorts if me.destroyed is true, just early return.

We can get here because this is a delayed task, i.e., async,
everything can happen in between triggering it and receiving the
actual callback, so guard!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/tree/SnapshotTree.js

index e365a16eebf5e012831b77729089046fbdcdf2a2..e186bea76e0156c3db269999fee8f01c3fa9787d 100644 (file)
@@ -111,10 +111,16 @@ Ext.define('PVE.guest.SnapshotTree', {
                url: `/nodes/${nodename}/${type}/${vmid}/snapshot`,
                method: 'GET',
                failure: function(response, opts) {
+                   if (me.destroyed) return;
                    Proxmox.Utils.setErrorMask(view, response.htmlStatus);
                    me.load_task.delay(load_delay);
                },
                success: function(response, opts) {
+                   if (me.destroyed) {
+                       // this is in a delayed task, avoid dragons if view has
+                       // been destroyed already and go home.
+                       return;
+                   }
                    Proxmox.Utils.setErrorMask(view, false);
                    var digest = 'invalid';
                    var idhash = {};