Skip to content

Commit 45eef8b

Browse files
authored
Devtools: improve getID guard (#19364)
1 parent 392277f commit 45eef8b

File tree

1 file changed

+1
-1
lines changed
  • packages/react-devtools-shared/src/backend/legacy

1 file changed

+1
-1
lines changed

packages/react-devtools-shared/src/backend/legacy/renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function attach(
165165
}
166166

167167
function getID(internalInstance: InternalInstance): number {
168-
if (typeof internalInstance !== 'object') {
168+
if (typeof internalInstance !== 'object' || internalInstance === null) {
169169
throw new Error('Invalid internal instance: ' + internalInstance);
170170
}
171171
if (!internalInstanceToIDMap.has(internalInstance)) {

0 commit comments

Comments
 (0)