From 9823a4e7ddff94f0ee76cd952cc2e7e9101045d4 Mon Sep 17 00:00:00 2001 From: "Julien Carion (juca)" Date: Wed, 2 Aug 2023 15:33:28 +0200 Subject: [PATCH] [FIX] devtools: fix inspected path This commit fixes the handling of the inspected path in the getComponentsTree method so that it is reset when the given one does not exist anymore. It solves a crash of the method anytime this would happen which would prevent the tree from updating correctly. --- tools/devtools/src/page_scripts/owl_devtools_global_hook.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/devtools/src/page_scripts/owl_devtools_global_hook.js b/tools/devtools/src/page_scripts/owl_devtools_global_hook.js index c8401240..05e0baaf 100644 --- a/tools/devtools/src/page_scripts/owl_devtools_global_hook.js +++ b/tools/devtools/src/page_scripts/owl_devtools_global_hook.js @@ -1527,6 +1527,9 @@ // Use inspectedPath to specify the path of the selected component getComponentsTree(inspectedPath = null, oldTrees = null, oldDetails = null) { const appsArray = [...this.apps]; + if (inspectedPath && !this.getComponentNode(inspectedPath)) { + inspectedPath = null; + } const trees = appsArray.map((app, index) => { let oldTree; if (oldTrees) {