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,12 +496,14 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId( ...@@ -496,12 +496,14 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId(
tree = window_server()->GetTreeWithId(window->id().client_id); tree = window_server()->GetTreeWithId(window->id().client_id);
} }
const ServerWindow* embed_root = if (tree) {
tree->HasRoot(window) ? window : GetEmbedRoot(window); const ServerWindow* embed_root =
while (tree && tree->embedder_intercepts_events()) { tree->HasRoot(window) ? window : GetEmbedRoot(window);
DCHECK(tree->HasRoot(embed_root)); while (tree && tree->embedder_intercepts_events()) {
tree = window_server()->GetTreeWithId(embed_root->id().client_id); DCHECK(tree->HasRoot(embed_root));
embed_root = GetEmbedRoot(embed_root); tree = window_server()->GetTreeWithId(embed_root->id().client_id);
embed_root = GetEmbedRoot(embed_root);
}
} }
if (!tree) { if (!tree) {
......
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