Commit f6bfdab2 authored by Brandon Wylie's avatar Brandon Wylie Committed by Commit Bot

Ensure web_contents is non-null before TabAndroid::FromWebContents

Bug: 1094885
Change-Id: Ie3fb46b2fb7029671f91612fefee7fcb2352a613
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353012Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797438}
parent 1e4adb7e
......@@ -4444,14 +4444,14 @@ ChromeContentBrowserClient::CreateURLLoaderThrottles(
web_contents);
if (client_data_header_observer)
client_data_header = client_data_header_observer->header();
}
auto* delegate = TabAndroid::FromWebContents(web_contents)
? static_cast<android::TabWebContentsDelegateAndroid*>(
web_contents->GetDelegate())
: nullptr;
if (delegate) {
night_mode_enabled = delegate->IsNightModeEnabled();
auto* delegate =
TabAndroid::FromWebContents(web_contents)
? static_cast<android::TabWebContentsDelegateAndroid*>(
web_contents->GetDelegate())
: nullptr;
if (delegate)
night_mode_enabled = delegate->IsNightModeEnabled();
}
}
#endif
......
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