Index: chrome/browser/sync/glue/preference_model_associator.cc |
diff --git a/chrome/browser/sync/glue/preference_model_associator.cc b/chrome/browser/sync/glue/preference_model_associator.cc |
index be0345e45ff784479cb9dccb2ee07a89592eea25..dd9cb967f94c8bc4c49f137eab06316791655c82 100644 |
--- a/chrome/browser/sync/glue/preference_model_associator.cc |
+++ b/chrome/browser/sync/glue/preference_model_associator.cc |
@@ -73,8 +73,15 @@ bool PreferenceModelAssociator::InitPrefNodeAndAssociate( |
// Update the local preference based on what we got from the |
// sync server. |
- if (!pref->GetValue()->Equals(new_value.get())) |
+ if (new_value->IsType(Value::TYPE_NULL)) { |
+ pref_service->ClearPref(pref_name.c_str()); |
+ } else if (!new_value->IsType(pref->GetType())) { |
+ LOG(WARNING) << "Synced value for " << preference.name() |
+ << " is of type " << new_value->GetType() |
+ << " which doesn't match pref type " << pref->GetType(); |
+ } else if (!pref->GetValue()->Equals(new_value.get())) { |
pref_service->Set(pref_name.c_str(), *new_value); |
+ } |
AfterUpdateOperations(pref_name); |