From 6050827689338d4a71f77ddbc4fb4c28fee23a32 Mon Sep 17 00:00:00 2001 From: "Julien Carion (juca)" Date: Thu, 20 Jul 2023 11:18:28 +0200 Subject: [PATCH] [FIX] devtools: fix crash while highlighting env This commit fixes a crash that could happen in the keepEnvLit method when passing through the env of the inspected component. --- tools/devtools/src/devtools_app/store/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devtools/src/devtools_app/store/store.js b/tools/devtools/src/devtools_app/store/store.js index 70705728..8ef5aff2 100644 --- a/tools/devtools/src/devtools_app/store/store.js +++ b/tools/devtools/src/devtools_app/store/store.js @@ -899,7 +899,7 @@ function keepEnvLit(details) { alreadyMet.add(details.env.children[i].name); } else { let lastElement = details.env.children[i]; - while (lastElement.children.at(-1).name === "[[Prototype]]") { + while (lastElement.children.at(-1)?.name === "[[Prototype]]") { for (const [index, child] of lastElement.children.entries()) { if (index < lastElement.children.length - 1) { if (!alreadyMet.has(child.name)) {