Bug 226995 - [REGRESSION: r276616] Uncaught Exception: TypeError: undefined is not an object (evaluating 'this._setupCodeMirror.getValue')
Summary: [REGRESSION: r276616] Uncaught Exception: TypeError: undefined is not an obje...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Patrick Angle
URL: https://webkit.org/
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-14 15:56 PDT by Patrick Angle
Modified: 2021-06-14 17:46 PDT (History)
5 users (show)

See Also:


Attachments
Patch v1.0 (1.91 KB, patch)
2021-06-14 16:23 PDT, Patrick Angle
no flags Details | Formatted Diff | Diff
Patch v1.1 - Review nit (1.99 KB, patch)
2021-06-14 16:48 PDT, Patrick Angle
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Angle 2021-06-14 15:56:54 PDT
Uncaught Exception in Web Inspector.

Steps to Reproduce:
1. Go to the Audits tab.
2. Enter edit mode.
3. Create a new audit group with any name.
4. Add some code to the single test case and to the setup.
5. Select a different audit group.
6. Encounter this exception and have your data thrown away.

Uncaught Exceptions:
-----------------------
 - TypeError: undefined is not an object (evaluating 'this._setupCodeMirror.getValue') (at AuditTestContentView.js:320:61)
    saveEditedData @ AuditTestContentView.js:320:61
    saveEditedData @ AuditTestCaseContentView.js:326:29
    detached @ AuditTestContentView.js:291:36
    _didMoveToWindow @ View.js:266:26
    _didMoveToParent @ View.js:238:30
    removeAllSubviews @ View.js:138:37
    detached @ AuditTestGroupContentView.js:228:43
    _didMoveToWindow @ View.js:266:26
    _didMoveToParent @ View.js:238:30
    removeSubview @ View.js:129:30
    _hideEntry @ ContentViewContainer.js:464:31
    showBackForwardEntryForIndex @ ContentViewContainer.js:161:28
    showContentView @ ContentViewContainer.js:141:42
    showRepresentedObject @ ContentBrowserTabContentView.js:218:64
    ? @ Main.js:1426:41
    _treeSelectionDidChange @ AuditNavigationSidebarPanel.js:375:37
    dispatch @ Object.js:134:35
    dispatchEventToListeners @ Object.js:142:17
    _dispatchSelectionDidChangeEvent @ TreeOutline.js:1083:38
    selectionControllerSelectionDidChange @ TreeOutline.js:755:46
    _updateSelectedItems @ SelectionController.js:458:65
    selectItem @ SelectionController.js:155:34
    handleItemMouseDown @ SelectionController.js:322:28
    _handleMouseDown @ TreeOutline.js:1067:54
    _handleMouseDown @ [native code]
-----------------------

Notes:
Inspected URL:        https://webkit.org/
Loading completed:    true
Frontend User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)
Comment 1 Radar WebKit Bug Importer 2021-06-14 15:57:21 PDT
<rdar://problem/79312323>
Comment 2 Patrick Angle 2021-06-14 16:23:24 PDT
Created attachment 431379 [details]
Patch v1.0
Comment 3 Devin Rousso 2021-06-14 16:40:53 PDT
Comment on attachment 431379 [details]
Patch v1.0

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

r=me

> Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js:319
> +        if (!this._setupCodeMirror)

NIT: I'd not have this be an early return just so that if more fields are added in the future it makes the diff cleaner :)
Comment 4 Patrick Angle 2021-06-14 16:45:44 PDT
Comment on attachment 431379 [details]
Patch v1.0

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

>> Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js:319
>> +        if (!this._setupCodeMirror)
> 
> NIT: I'd not have this be an early return just so that if more fields are added in the future it makes the diff cleaner :)

Fair enough.
Comment 5 Patrick Angle 2021-06-14 16:48:19 PDT
Created attachment 431386 [details]
Patch v1.1 - Review nit
Comment 6 EWS 2021-06-14 17:46:28 PDT
Committed r278853 (238799@main): <https://commits.webkit.org/238799@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431386 [details].