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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 10538041: Add some NULL-checks for ExtensionHost::extension to fix a crash bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index fd3a2a347aa9ff2dca44dad2422f712ee1638d63..32a5e25d6c581602a74bb31485a65ded7eaa57ec 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -159,7 +159,7 @@ ExtensionHost::ExtensionHost(const extensions::Extension* extension,
ExtensionHost::~ExtensionHost() {
if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE &&
- extension_->has_lazy_background_page()) {
+ extension_ && extension_->has_lazy_background_page()) {
UMA_HISTOGRAM_LONG_TIMES("Extensions.EventPageActiveTime",
since_created_.Elapsed());
}
@@ -350,7 +350,7 @@ void ExtensionHost::DidStopLoading() {
}
if (notify) {
if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
- if (extension_->has_lazy_background_page()) {
+ if (extension_ && extension_->has_lazy_background_page()) {
UMA_HISTOGRAM_TIMES("Extensions.EventPageLoadTime",
since_created_.Elapsed());
} else {
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698