Changeset 200995 in webkit


Ignore:
Timestamp:
May 16, 2016 9:11:41 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Uncaught Exception: TypeError: null is not an object (evaluating 'event.data.pathComponent.domTreeElement')
https://bugs.webkit.org/show_bug.cgi?id=157759
<rdar://problem/26309427>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-05-16
Reviewed by Timothy Hatcher.

  • UserInterface/Views/DOMTreeContentView.js:

(WebInspector.DOMTreeContentView.prototype._pathComponentSelected):
Handle possible null path components.

  • UserInterface/Views/HierarchicalPathComponent.js:

(WebInspector.HierarchicalPathComponent.prototype.get selectedPathComponent):
When there is a list of just one that is triggered, the Clicked
event should produce that one, to be consistent with clicking
on a list of multiple elements and selecting the same value.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r200981 r200995  
     12016-05-16  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Uncaught Exception: TypeError: null is not an object (evaluating 'event.data.pathComponent.domTreeElement')
     4        https://bugs.webkit.org/show_bug.cgi?id=157759
     5        <rdar://problem/26309427>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/DOMTreeContentView.js:
     10        (WebInspector.DOMTreeContentView.prototype._pathComponentSelected):
     11        Handle possible null path components.
     12
     13        * UserInterface/Views/HierarchicalPathComponent.js:
     14        (WebInspector.HierarchicalPathComponent.prototype.get selectedPathComponent):
     15        When there is a list of just one that is triggered, the Clicked
     16        event should produce that one, to be consistent with clicking
     17        on a list of multiple elements and selecting the same value.
     18
    1192016-05-16  Saam barati  <sbarati@apple.com>
    220
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js

    r192086 r200995  
    372372    _pathComponentSelected(event)
    373373    {
     374        if (!event.data.pathComponent)
     375            return;
     376
    374377        console.assert(event.data.pathComponent instanceof WebInspector.DOMTreeElementPathComponent);
    375378        console.assert(event.data.pathComponent.domTreeElement instanceof WebInspector.DOMTreeElement);
  • trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js

    r196275 r200995  
    8787    get selectedPathComponent()
    8888    {
    89         var selectElement = this._selectElement[this._selectElement.selectedIndex];
    90         return selectElement && selectElement._pathComponent || null;
     89        let selectedOption = this._selectElement[this._selectElement.selectedIndex];
     90        if (!selectedOption && this._selectElement.options.length === 1)
     91            selectedOption = this._selectElement.options[0];
     92        return selectedOption && selectedOption._pathComponent || null;
    9193    }
    9294
Note: See TracChangeset for help on using the changeset viewer.