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

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

Issue 1835863002: Added check for behavior feature existense (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Get*Feature return |nullptr| instead crash if feature is missing Created 4 years, 8 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 | « no previous file | chrome/browser/ui/extensions/application_launch.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_util.cc
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc
index 6cb221c18faa016ed3cb4c3e356385390e3f7803..1a6f24259e0d091ef8616f335474b5d63260b0db 100644
--- a/chrome/browser/extensions/extension_util.cc
+++ b/chrome/browser/extensions/extension_util.cc
@@ -28,6 +28,7 @@
#include "extensions/common/extension_icon_set.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/features/behavior_feature.h"
+#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_handlers/app_isolation_info.h"
@@ -55,10 +56,9 @@ const char kHasSetScriptOnAllUrlsPrefName[] = "has_set_script_all_urls";
// Returns true if |extension| should always be enabled in incognito mode.
bool IsWhitelistedForIncognito(const Extension* extension) {
- return FeatureProvider::GetBehaviorFeature(
- BehaviorFeature::kWhitelistedForIncognito)
- ->IsAvailableToExtension(extension)
- .is_available();
+ const Feature* feature = FeatureProvider::GetBehaviorFeature(
+ BehaviorFeature::kWhitelistedForIncognito);
+ return feature && feature->IsAvailableToExtension(extension).is_available();
}
// Returns |extension_id|. See note below.
« no previous file with comments | « no previous file | chrome/browser/ui/extensions/application_launch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698