From ed6721d0ff093009ed23af2b7991bdeb1e1dfa25 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 21 Nov 2022 08:53:42 +0100 Subject: [PATCH] log, journal view: fix access to `me` after destroying it can happen that the view is destroyed during an api call, so we should check if it's destroyed as the first thing in the callback if the view is destroyed, there is nothing we can do here, so simply return Signed-off-by: Dominik Csapak --- src/panel/JournalView.js | 3 +++ src/panel/LogView.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/panel/JournalView.js b/src/panel/JournalView.js index f3af36b..32c005a 100644 --- a/src/panel/JournalView.js +++ b/src/panel/JournalView.js @@ -143,6 +143,9 @@ Ext.define('Proxmox.panel.JournalView', { waitMsgTarget: !livemode ? view : undefined, method: 'GET', success: function(response) { + if (me.isDestroyed) { + return; + } Proxmox.Utils.setErrorMask(me, false); let lines = response.result.data; me.updateView(lines, livemode, top); diff --git a/src/panel/LogView.js b/src/panel/LogView.js index dcbd002..44aa8e3 100644 --- a/src/panel/LogView.js +++ b/src/panel/LogView.js @@ -98,6 +98,9 @@ Ext.define('Proxmox.panel.LogView', { params: viewModel.get('params'), method: 'GET', success: function(response) { + if (me.isDestroyed) { + return; + } Proxmox.Utils.setErrorMask(me, false); let total = response.result.total; let lines = [];