From b601ff5a09e4af8c01cf35df4e539da3c6158300 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 25 Aug 2021 08:53:14 -0700 Subject: [PATCH] Fix crash on missing children Summary: T98487412 is firing again. This seems to be an expected case that's not handled correctly. thinkofthechildren Reviewed By: fabiomassimo Differential Revision: D30539615 fbshipit-source-id: d9625bb0a7b3622e5afb6e768bc525c27fdfb02d --- desktop/plugins/public/layout/Inspector.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/public/layout/Inspector.tsx b/desktop/plugins/public/layout/Inspector.tsx index 696c37788..7b49dde9a 100644 --- a/desktop/plugins/public/layout/Inspector.tsx +++ b/desktop/plugins/public/layout/Inspector.tsx @@ -299,7 +299,8 @@ export default class Inspector extends Component { await this.getNodes([id], options); } this.updateElement(id, {expanded: true}); - return this.getNodes(this.elements()[id].children, options); + const element: Element | undefined = this.elements()[id]; + return this.getNodes((element && element.children) || [], options); } async getNodes(