Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Unified Diff: chrome/browser/geolocation/chrome_geolocation_permission_context.cc

Issue 282693002: Add a null check for PermissionBubbleManager::FromWebcontents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/geolocation/chrome_geolocation_permission_context.cc
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index 37d03269ce7577020014157baf08772e333ea15f..6b3eb194fe6acadabffa0c994fc6329b340f242f 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -242,9 +242,11 @@ void ChromeGeolocationPermissionContext::DecidePermission(
if (PermissionBubbleManager::Enabled()) {
PermissionBubbleManager* mgr =
PermissionBubbleManager::FromWebContents(web_contents);
- mgr->AddRequest(new GeolocationPermissionRequest(
- this, id, requesting_frame, user_gesture, callback,
- profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)));
+ if (mgr) {
+ mgr->AddRequest(new GeolocationPermissionRequest(
+ this, id, requesting_frame, user_gesture, callback,
+ profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)));
+ }
} else {
// setting == ask. Prompt the user.
QueueController()->CreateInfoBarRequest(
« no previous file with comments | « chrome/browser/chrome_quota_permission_context.cc ('k') | chrome/browser/media/chrome_midi_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698