Commit 8417a183 authored by nancylingwang's avatar nancylingwang Committed by Commit Bot

Add the null pointer checking to resolve the crash issue when shutdown.

Click the open with button at the browser url bar, then shutdown the
system, it crashes due to access the null pointer. So add the null
pointer checking to avoid the system crash.

BUG=1116344

Change-Id: I4c45983f8d626eabd98a8e0f188c32255ffbe0b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353779
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798281}
parent db50a5ab
......@@ -331,8 +331,12 @@ void AppServiceInstanceRegistryHelper::SetWindowActivated(
Browser* browser = chrome::FindBrowserWithWindow(window);
if (!browser)
return;
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
if (!contents)
return;
apps::InstanceState state = static_cast<apps::InstanceState>(
apps::InstanceState::kStarted | apps::InstanceState::kRunning |
apps::InstanceState::kActive | apps::InstanceState::kVisible);
......
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