Skip to content

Commit bcd3078

Browse files
committed
fix: check window.__REACT_DEVTOOLS_GLOBAL_HOOK__ not null before use it in main.js
1 parent da75276 commit bcd3078

File tree

1 file changed

+1
-1
lines changed
  • packages/react-devtools-extensions/src

1 file changed

+1
-1
lines changed

packages/react-devtools-extensions/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ function createPanelIfReactLoaded() {
271271
// When the user chooses a different node in the browser Elements tab,
272272
// copy it over to the hook object so that we can sync the selection.
273273
chrome.devtools.inspectedWindow.eval(
274-
'(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 !== $0) ?' +
274+
'(window.__REACT_DEVTOOLS_GLOBAL_HOOK__ && window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 !== $0) ?' +
275275
'(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 = $0, true) :' +
276276
'false',
277277
(didSelectionChange, evalError) => {

0 commit comments

Comments
 (0)