@samitouri / QOS-React / commits / 45eef8b6b5

Devtools: improve getID guard (#19364)

Dominic Gannaway committed Jul 15, 2020 at 14:17 UTC 45eef8b6b5df27c661b3e33e579abc11b563c65b
1 file changed +1 -1
packages/react-devtools-shared/src/backend/legacy/renderer.js
+1 -1
@@ -165,7 +165,7 @@ export function attach(
165 }
166
167 function getID(internalInstance: InternalInstance): number {
168 - if (typeof internalInstance !== 'object') {
168 + if (typeof internalInstance !== 'object' || internalInstance === null) {
169 throw new Error('Invalid internal instance: ' + internalInstance);
170 }
171 if (!internalInstanceToIDMap.has(internalInstance)) {