From 41dd757616e7c7a0cfaa460649a5c5c6436ef0e8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 26 Nov 2021 03:52:02 -0800 Subject: [PATCH] More defensively handle initial expand Reviewed By: jknoxville Differential Revision: D32674423 fbshipit-source-id: 0d8216ebb9da9530c53c7209dcd18eb677c73fc3 --- desktop/plugins/public/layout/Inspector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/public/layout/Inspector.tsx b/desktop/plugins/public/layout/Inspector.tsx index 44632e03e..3b2893d77 100644 --- a/desktop/plugins/public/layout/Inspector.tsx +++ b/desktop/plugins/public/layout/Inspector.tsx @@ -281,7 +281,7 @@ export default class Inspector extends Component { // When opening the inspector for the first time, expand all elements that // contain only 1 child recursively. async performInitialExpand(element: Element | undefined): Promise { - if (!element || !element.children.length) { + if (!element || !element.children || !element.children.length) { // element has no children so we're as deep as we can be return; }