From 03573e07d8e9674daa560d119bb2f65c808ff405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Charva=CC=81t?= Date: Fri, 10 Jul 2026 13:24:02 +0200 Subject: [PATCH] fix(core): guard EntityLoader against node destroyed during async load --- www/go/core/views/extjs3/tree/EntityLoader.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/www/go/core/views/extjs3/tree/EntityLoader.js b/www/go/core/views/extjs3/tree/EntityLoader.js index d66cbb56df..08657e9303 100644 --- a/www/go/core/views/extjs3/tree/EntityLoader.js +++ b/www/go/core/views/extjs3/tree/EntityLoader.js @@ -89,17 +89,24 @@ go.tree.EntityLoader = Ext.extend(Ext.tree.TreeLoader, { // params.sort = [params.sort + " " + params.dir]; // delete params.dir; // } - + this.result = this.entityStore.query(params, function (response) { this.entityStore.get(response.ids, function (entities) { + // Check if node was destroyed during async load + var node = options.node; + if (!node || !node.ui || !node.getOwnerTree()) { + this.loading = false; + return; + } + const result = { - argument: {callback: callback, node: options.node, scope: scope}, + argument: {callback: callback, node: node, scope: scope}, responseData: entities.map(this.convertEntityToNode, this), queryResponse: response }; - + this.handleResponse(result); - + this.loading = false; },this); }, this);