Bug 211593

Summary: Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'mimeType.endsWith')
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2020-05-07 13:24:27 PDT
Uncaught Exception in Web Inspector.

# STEPS TO REPRODUCE:
1. inspect a page with a `<form method="post">`
2. attempt to view the resource after submitting

Uncaught Exceptions:
-----------------------
 - TypeError: null is not an object (evaluating "mimeType.endsWith") (at ResourceClusterContentView.js:441:21)
    _normalizeMIMETypeForDOM @ ResourceClusterContentView.js:441:21
    _tryEnableCustomRequestContentViews @ ResourceClusterContentView.js:477:53
    ResourceClusterContentView @ ResourceClusterContentView.js:50:53
    createFromRepresentedObject @ ContentView.js:49:53
    contentViewForRepresentedObject @ ContentView.js:214:72
    showContentViewForRepresentedObject @ ContentBrowser.js:151:63
    showDefaultContentViewForTreeElement @ NavigationSidebarPanel.js:203:82
    _checkElementsForPendingViewStateCookie @ NavigationSidebarPanel.js:723:79
    _checkOutlinesForPendingViewStateCookie @ NavigationSidebarPanel.js:679:53
    restoreStateFromCookie @ NavigationSidebarPanel.js:246:53
    restoreStateFromCookie @ TabContentView.js:150:63
    ? @ Main.js:1761:46
    ? @ Main.js:1737:37
-----------------------

Notes:
Inspected URL:        http://localhost/test.html
Loading completed:    true
Frontend User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko)
Comment 1 Devin Rousso 2020-05-07 13:25:10 PDT
Created attachment 398789 [details]
Patch
Comment 2 Joseph Pecoraro 2020-05-07 14:16:59 PDT
Comment on attachment 398789 [details]
Patch

Something like this should really have a test.
Comment 3 Devin Rousso 2020-05-07 14:32:03 PDT
Comment on attachment 398789 [details]
Patch

(In reply to Joseph Pecoraro from comment #2)
> Something like this should really have a test.
Unfortunately, this is deep inside View code :(

Unless you're referring to tests of `parseMIMEType` itself, which we currently don't have any of (but I could add).
Comment 4 Devin Rousso 2020-05-07 15:46:47 PDT
Created attachment 398807 [details]
Patch
Comment 5 EWS 2020-05-07 16:22:19 PDT
Committed r261344: <https://trac.webkit.org/changeset/261344>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398807 [details].
Comment 6 Radar WebKit Bug Importer 2020-05-07 16:23:14 PDT
<rdar://problem/62997818>