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

Unified Diff: chrome/common/extensions/sync_helper.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
Index: chrome/common/extensions/sync_helper.cc
diff --git a/chrome/common/extensions/sync_helper.cc b/chrome/common/extensions/sync_helper.cc
index 1219073330969ca44992c268680f19db97540e7e..1a73e4b24d48f94b82e1b72cfa782e92b1f3c007 100644
--- a/chrome/common/extensions/sync_helper.cc
+++ b/chrome/common/extensions/sync_helper.cc
@@ -10,6 +10,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/extension.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_url_handlers.h"
@@ -19,11 +20,10 @@ namespace extensions {
namespace sync_helper {
bool IsSyncable(const Extension* extension) {
- if (FeatureProvider::GetBehaviorFeature(BehaviorFeature::kDoNotSync)
- ->IsAvailableToExtension(extension)
- .is_available()) {
+ const Feature* feature =
+ FeatureProvider::GetBehaviorFeature(BehaviorFeature::kDoNotSync);
+ if (feature && feature->IsAvailableToExtension(extension).is_available())
return false;
- }
// Default apps are not synced because otherwise they will pollute profiles
// that don't already have them. Specially, if a user doesn't have default
« no previous file with comments | « chrome/browser/ui/extensions/application_launch.cc ('k') | extensions/browser/extension_zoom_request_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698