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
This commit is contained in:
Pascal Hartig
2021-08-25 08:53:14 -07:00
committed by Facebook GitHub Bot
parent 87580c4147
commit b601ff5a09

View File

@@ -299,7 +299,8 @@ export default class Inspector extends Component<Props, State> {
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(