Commit ac54bf90 authored by sudarsana.nagineni's avatar sudarsana.nagineni Committed by Commit bot

Fix a browser crash on opening 'chrome://voicesearch' in guest mode.

Navigating directly to chrome://voicesearch in guest mode is causing
a crash, since the HotwordService is NULL in the guest mode. This
patch adds a NULL check on HotwordService to fix the crash.

BUG=411784
TEST=With --new-profile-management enabled, try to open chrome://voicesearch
in guest mode.

Review URL: https://codereview.chromium.org/554603002

Cr-Commit-Position: refs/heads/master@{#294149}
parent 08a76ea6
......@@ -245,7 +245,7 @@ class VoiceSearchDomHandler : public WebUIMessageHandler {
std::string audio_logging_enabled = "No";
HotwordService* hotword_service =
HotwordServiceFactory::GetForProfile(profile_);
if (hotword_service->IsOptedIntoAudioLogging())
if (hotword_service && hotword_service->IsOptedIntoAudioLogging())
audio_logging_enabled = "Yes";
AddPair(list, ASCIIToUTF16("Hotword Audio Logging Enabled"),
ASCIIToUTF16(audio_logging_enabled));
......
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