Commit 4f8db347 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Fix ash::IsToplevelWindow to support window's parent existence

I've just noticed that crrev.com/606339 causes a crash, and that's
because PrintWindowHierarchy starts from a root window, which
do not have a parent, but it tries to call IsToplevelWindow() which
assumes the existence of the parent.

BUG=none
TEST=manually

Change-Id: Ie4460302674d057a6c7960e0b012c80b63e06a2c
Reviewed-on: https://chromium-review.googlesource.com/c/1327560Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606651}
parent a0699cfa
...@@ -16,7 +16,7 @@ namespace ash { ...@@ -16,7 +16,7 @@ namespace ash {
bool IsToplevelWindow(aura::Window* window) { bool IsToplevelWindow(aura::Window* window) {
DCHECK(window); DCHECK(window);
// The window must in a valid hierarchy. // The window must in a valid hierarchy.
if (!window->GetRootWindow()) if (!window->GetRootWindow() || !window->parent())
return false; return false;
// The window must exist within a container that supports activation. // The window must exist within a container that supports activation.
......
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