Commit da2cd8dd authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Prevent crash in InspectorLayerTreeAgent when the root layer is nullptr

Bug: 1011914
Change-Id: I2978b8bd6c7ee94c133b4a133c9df311382fc963
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377610Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801922}
parent bf78c3f1
......@@ -348,6 +348,8 @@ const cc::Layer* InspectorLayerTreeAgent::RootLayer() {
}
static const cc::Layer* FindLayerById(const cc::Layer* root, int layer_id) {
if (!root)
return nullptr;
if (root->id() == layer_id)
return root;
for (auto child : root->children()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment