From 87ae19d1eeb26a2617d43607c4a175f46e69b10d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 30 Jan 2020 20:03:23 +0100 Subject: [PATCH] ui snapshot tree: avoid another exception in delayd load when view is gone 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 --- www/manager6/tree/SnapshotTree.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/manager6/tree/SnapshotTree.js b/www/manager6/tree/SnapshotTree.js index e365a16e..e186bea7 100644 --- a/www/manager6/tree/SnapshotTree.js +++ b/www/manager6/tree/SnapshotTree.js @@ -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 = {};