Commit c0ddac38 authored by erg's avatar erg Committed by Commit bot

mash: Don't crash when dragging a window to the side.

WindowServer::GetTreeWithId can be null in the case of
|in_nonclient_area|. It looks like |tree| was used without check in
4d3588cb.

BUG=630402

Review-Url: https://codereview.chromium.org/2170053003
Cr-Commit-Position: refs/heads/master@{#407181}
parent f255d87c
...@@ -496,6 +496,7 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId( ...@@ -496,6 +496,7 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId(
tree = window_server()->GetTreeWithId(window->id().client_id); tree = window_server()->GetTreeWithId(window->id().client_id);
} }
if (tree) {
const ServerWindow* embed_root = const ServerWindow* embed_root =
tree->HasRoot(window) ? window : GetEmbedRoot(window); tree->HasRoot(window) ? window : GetEmbedRoot(window);
while (tree && tree->embedder_intercepts_events()) { while (tree && tree->embedder_intercepts_events()) {
...@@ -503,6 +504,7 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId( ...@@ -503,6 +504,7 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId(
tree = window_server()->GetTreeWithId(embed_root->id().client_id); tree = window_server()->GetTreeWithId(embed_root->id().client_id);
embed_root = GetEmbedRoot(embed_root); embed_root = GetEmbedRoot(embed_root);
} }
}
if (!tree) { if (!tree) {
DCHECK(in_nonclient_area); DCHECK(in_nonclient_area);
......
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