Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
index 8da51836079251d2f003e8392add0cdfd688d842..e69de7593ac0b62ec082841cf32c6a498d158ea9 100644 |
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
@@ -446,7 +446,9 @@ ContentSettingCookiesBubbleModel::ContentSettingCookiesBubbleModel( |
} |
ContentSettingCookiesBubbleModel::~ContentSettingCookiesBubbleModel() { |
- if (settings_changed()) { |
+ // On some plattforms e.g. MacOS X it is possible to close a tab while the |
+ // cookies settubgs bubble is open. This resets the web contents to NULL. |
+ if (settings_changed() && web_contents()) { |
CollectedCookiesInfoBarDelegate::Create( |
InfoBarService::FromWebContents(web_contents())); |
} |
@@ -610,6 +612,10 @@ ContentSettingMediaStreamBubbleModel::ContentSettingMediaStreamBubbleModel( |
} |
ContentSettingMediaStreamBubbleModel::~ContentSettingMediaStreamBubbleModel() { |
+ // On some plattforms e.g. MacOS X it is possible to close a tab while the |
+ // media stream bubble is open. This resets the web contents to NULL. |
+ if (!web_contents()) |
+ return; |
bool media_setting_changed = false; |
for (MediaMenuMap::const_iterator it = bubble_content().media_menus.begin(); |
it != bubble_content().media_menus.end(); ++it) { |