ui snapshot tree: avoid another exception in delayd load when view is gone

similar story than commit 9cc4958f5a
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>
This commit is contained in:
Thomas Lamprecht 2020-01-30 20:03:23 +01:00
parent 9cc4958f5a
commit 87ae19d1ee

View 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 = {};