Bug 169852

Summary: Web Inspector: Clicking on Clear Network Items icon throws an exception if timing popover is visible
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
joepeck: review+
Patch none

Description Nikita Vasilyev 2017-03-18 14:43:30 PDT
Uncaught Exceptions:
 - TypeError: null is not an object (evaluating 'this.dataGrid._popover') (at ResourceTimelineDataGridNode.js:424:82)
    ? @ ResourceTimelineDataGridNode.js:424:82

* STEPS TO REPRODUCE
1. In Web Inspector, open Network tab
2. Open http://webkit.org/
3. Hover over the timing bar at the right side of the content view to show the timing information popover.
4. Quickly click on the Clear Network Items icon.
Comment 1 Radar WebKit Bug Importer 2017-03-18 14:44:44 PDT
<rdar://problem/31132652>
Comment 2 Nikita Vasilyev 2017-03-18 14:55:38 PDT
Created attachment 304879 [details]
Patch
Comment 3 Joseph Pecoraro 2017-03-20 16:48:02 PDT
Comment on attachment 304879 [details]
Patch

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

r=me

> Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js:430
> +            let dismissPopover = () => {
> +                if (this.dataGrid)
> +                    this.dataGrid._popover.dismiss();
> +            };
> +
> +            this.dataGrid._dismissPopoverTimeout = setTimeout(dismissPopover, WebInspector.ResourceTimelineDataGridNode.DelayedPopoverDismissalTimeout);

Style: We normally inline arrow functions used in only one place:

    this.dataGrid._dismissPopoverTimeout = setTimeout(() => {
        if (this.dataGrid)
            this.dataGrid._popover.dismiss();
    }, WebInspector.ResourceTimelineDataGridNode.DelayedPopoverDismissalTimeout);
Comment 4 Nikita Vasilyev 2017-03-20 17:20:24 PDT
Created attachment 304974 [details]
Patch
Comment 5 WebKit Commit Bot 2017-03-20 18:01:25 PDT
Comment on attachment 304974 [details]
Patch

Clearing flags on attachment: 304974

Committed r214199: <http://trac.webkit.org/changeset/214199>
Comment 6 WebKit Commit Bot 2017-03-20 18:01:29 PDT
All reviewed patches have been landed.  Closing bug.