⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282477 in webkit


Ignore:
Timestamp:
Sep 15, 2021, 3:12:01 PM (5 years ago)
Author:
Patrick Angle
Message:

Web Inspector: TreeOutline should return early when failing to find an ancestor while populating the tree
​https://bugs.webkit.org/show_bug.cgi?id=230287

Reviewed by Devin Rousso.

When an ancestor can not be found, we should return to prevent additional work (which will fail) from being done.

  • UserInterface/Views/TreeOutline.js:

(WI.TreeOutline.prototype.findTreeElement):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r282475 r282477  
     12021-09-15  Patrick Angle  <pangle@apple.com>
     2
     3        Web Inspector: `TreeOutline` should return early when failing to find an ancestor while populating the tree
     4        https://bugs.webkit.org/show_bug.cgi?id=230287
     5
     6        Reviewed by Devin Rousso.
     7
     8        When an ancestor can not be found, we should return to prevent additional work (which will fail) from being done.
     9
     10        * UserInterface/Views/TreeOutline.js:
     11        (WI.TreeOutline.prototype.findTreeElement):
     12
    1132021-09-15  Patrick Angle  <pangle@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

    r269359 r282477  
    517517            // ancestor exists in the tree.
    518518            item = this.findTreeElement(ancestors[i], isAncestor, getParent);
    519             if (item)
    520                 item.onpopulate();
     519            if (!item)
     520                return null;
     521
     522            item.onpopulate();
    521523        }
    522524
Note: See TracChangeset for help on using the changeset viewer.