Index: chrome/browser/policy/configuration_policy_handler.cc |
diff --git a/chrome/browser/policy/configuration_policy_handler.cc b/chrome/browser/policy/configuration_policy_handler.cc |
index be6524f238f969ce41987b01f376f44bbc03f70b..07120fbe374794069e40a79f1f454a18ab3b7003 100644 |
--- a/chrome/browser/policy/configuration_policy_handler.cc |
+++ b/chrome/browser/policy/configuration_policy_handler.cc |
@@ -292,6 +292,8 @@ bool StringToIntEnumListPolicyHandler::CheckPolicySettings( |
void StringToIntEnumListPolicyHandler::ApplyPolicySettings( |
const PolicyMap& policies, |
PrefValueMap* prefs) { |
+ if (!pref_path_) |
+ return; |
const base::Value* value = policies.GetValue(policy_name()); |
scoped_ptr<base::ListValue> list(new base::ListValue()); |
if (value && Convert(value, list.get(), NULL)) |
@@ -360,6 +362,8 @@ IntRangePolicyHandler::~IntRangePolicyHandler() { |
void IntRangePolicyHandler::ApplyPolicySettings(const PolicyMap& policies, |
PrefValueMap* prefs) { |
+ if (!pref_path_) |
+ return; |
const base::Value* value = policies.GetValue(policy_name()); |
int value_in_range; |
if (value && EnsureInRange(value, &value_in_range, NULL)) { |
@@ -386,6 +390,8 @@ IntPercentageToDoublePolicyHandler::~IntPercentageToDoublePolicyHandler() { |
void IntPercentageToDoublePolicyHandler::ApplyPolicySettings( |
const PolicyMap& policies, |
PrefValueMap* prefs) { |
+ if (!pref_path_) |
+ return; |
const base::Value* value = policies.GetValue(policy_name()); |
int percentage; |
if (value && EnsureInRange(value, &percentage, NULL)) { |
@@ -616,6 +622,8 @@ bool ExtensionURLPatternListPolicyHandler::CheckPolicySettings( |
void ExtensionURLPatternListPolicyHandler::ApplyPolicySettings( |
const PolicyMap& policies, |
PrefValueMap* prefs) { |
+ if (!pref_path_) |
+ return; |
const Value* value = policies.GetValue(policy_name()); |
if (value) |
prefs->SetValue(pref_path_, value->DeepCopy()); |
@@ -636,6 +644,8 @@ SimplePolicyHandler::~SimplePolicyHandler() { |
void SimplePolicyHandler::ApplyPolicySettings(const PolicyMap& policies, |
PrefValueMap* prefs) { |
+ if (!pref_path_) |
+ return; |
const Value* value = policies.GetValue(policy_name()); |
if (value) |
prefs->SetValue(pref_path_, value->DeepCopy()); |