Fix access on undefined script object
I saw the following stacktrace while running Chromium locally: [205430:205430:1007/182130.681774:ERROR:CONSOLE(61)] "TypeError: Cannot read property 'originStackTrace' of null TypeError: Cannot read property 'originStackTrace' of null at Function._script (devtools://devtools/bundled/sources/sources_module.js:1469:197) at Sources.ScriptOriginPlugin.rightToolbarItems (devtools://devtools/bundled/sources/sources_module.js:1467:41) at Sources.UISourceCodeFrame.syncToolbarItems (devtools://devtools/bundled/sources/sources_module.js:335:215) at Sources.SourcesView._updateScriptViewToolbarItems (devtools://devtools/bundled/sources/sources_module.js:1215:168) at Sources.SourcesView._editorClosed (devtools://devtools/bundled/sources/sources_module.js:1226:43) at Sources.TabbedEditorContainer.dispatchEventToListeners (devtools://devtools/bundled/common/Object.js:12:173) at Sources.TabbedEditorContainer._tabClosed (devtools://devtools/bundled/sources/sources_module.js:1012:114) at TabbedPane.dispatchEventToListeners (devtools://devtools/bundled/common/Object.js:12:173) at TabbedPane._innerCloseTab (devtools://devtools/bundled/ui/TabbedPane.js:30:73) at TabbedPane.closeTabs (devtools://devtools/bundled/ui/TabbedPane.js:23:93)", source: devtools://devtools/bundled/host/InspectorFrontendHost.js (61) It appears that the code in this file already assumes that script can be undefined, but forgot this particular case. Change-Id: I7b0c0d34b4d16a1d29656cd8d86e3f290f8bb227 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845751 Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org> Reviewed-by:Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#703397}
Showing
Please register or sign in to comment