Bug 200296

Summary: Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'issueMessage.sourceCodeLocation.sourceCode')
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: https://www.youtube.com/user/NewOnNetflix/videos
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2019-07-31 00:26:31 PDT
-------
Inspected URL:        https://www.youtube.com/user/NewOnNetflix/videos
Loading completed:    true
Frontend User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko)

Uncaught Exceptions:
 - TypeError: null is not an object (evaluating 'issueMessage.sourceCodeLocation.sourceCode') (at DebuggerSidebarPanel.js:1406:111)
    _addIssue @ DebuggerSidebarPanel.js:1406:111
    _addIssuesForSourceCode @ DebuggerSidebarPanel.js:587:27
    _addResource @ DebuggerSidebarPanel.js:640:37
    _addResourcesRecursivelyForFrame @ DebuggerSidebarPanel.js:619:26
    DebuggerSidebarPanel @ DebuggerSidebarPanel.js:224:50
    navigationSidebarPanel @ TabContentView.js:171:87
    shown @ ContentBrowserTabContentView.js:101:17
    prepareToShow @ BackForwardEntry.js:84:35
    _showEntry @ ContentViewContainer.js:450:28
    showBackForwardEntryForIndex @ ContentViewContainer.js:166:28
    showContentView @ ContentViewContainer.js:142:42
    _tabBarItemSelected @ TabBrowser.js:238:55
    dispatch @ Object.js:165:30
    dispatchEventToListeners @ Object.js:172:17
    selectedTabBarItem @ LegacyTabBar.js:385:38
    _handleMouseDown @ LegacyTabBar.js:634:13
    _handleMouseDown @ [native code]
-------

* STEPS TO REPRODUCE
1. set a specific event listener breakpoint for every event listener on `#menu > a:nth-child(2) > paper-item > paper-item-body > div.item.style-scope.yt-dropdown-menu`.
2. disable all event listeners of every parent
3. tap the node
Comment 1 Devin Rousso 2019-07-31 00:58:58 PDT
Created attachment 375217 [details]
Patch
Comment 2 Joseph Pecoraro 2019-07-31 15:48:50 PDT
Comment on attachment 375217 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=375217&action=review

r=me

> Source/WebInspectorUI/ChangeLog:10
> +        we should pass the `WI.SourceCode` along in that case, and use it when creating a associated

Grammar: "a associate" => "an association"

> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:1407
> +        if (!sourceCode && !issueMessage.sourceCodeLocation)
> +            return null;

Can this ever happen? Could this just become an assert.

Seems the `debuggerObject` case is the only time this could happen.
Comment 3 Devin Rousso 2019-07-31 20:42:35 PDT
Comment on attachment 375217 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=375217&action=review

>> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:1407
>> +            return null;
> 
> Can this ever happen? Could this just become an assert.
> 
> Seems the `debuggerObject` case is the only time this could happen.

I don't think it can happen, because the `debuggerObject` path already checks for `debuggerObject.sourceCodeLocation.displaySourceCode`, so it should be valid there too.  I'll change it to an assert.
Comment 4 Devin Rousso 2019-07-31 20:46:35 PDT
Created attachment 375288 [details]
Patch
Comment 5 WebKit Commit Bot 2019-07-31 21:24:57 PDT
Comment on attachment 375288 [details]
Patch

Clearing flags on attachment: 375288

Committed r248094: <https://trac.webkit.org/changeset/248094>
Comment 6 WebKit Commit Bot 2019-07-31 21:24:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-07-31 21:25:33 PDT
<rdar://problem/53796065>