Devtools: improve getID guard (#19364)

This commit is contained in:
Dominic Gannaway
2020-07-15 14:17:48 +01:00
committed by GitHub
parent 392277f0ab
commit 45eef8b6b5
@@ -165,7 +165,7 @@ export function attach(
}
function getID(internalInstance: InternalInstance): number {
if (typeof internalInstance !== 'object') {
if (typeof internalInstance !== 'object' || internalInstance === null) {
throw new Error('Invalid internal instance: ' + internalInstance);
}
if (!internalInstanceToIDMap.has(internalInstance)) {