Commit 43e787c0 authored by Jun Cai's avatar Jun Cai Committed by Commit Bot

Network Service: Fix nullptr NavigationController for LoginHandler

This CL adds a nullptr check for NavigationController in
LoginHandler::Observe().

Bug: 817968
Change-Id: I08d9de516f7d3e788e644c38173ecb969ef8cb58
Reviewed-on: https://chromium-review.googlesource.com/944255Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
Commit-Queue: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540322}
parent 69e14282
......@@ -238,8 +238,8 @@ void LoginHandler::Observe(int type,
// Ignore login notification events from other profiles.
NavigationController* controller =
content::Source<NavigationController>(source).ptr();
if (controller->GetBrowserContext() !=
requesting_contents->GetBrowserContext()) {
if (!controller || controller->GetBrowserContext() !=
requesting_contents->GetBrowserContext()) {
return;
}
......
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