Commit ed353283 authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[Push] Add a type check for base::Value pref.

I'm not really sure why this is happening as we only store strings in
the dictionary. However there have been a few crash reports.

Bug: 1136031
Change-Id: I105bc90e4897ac01d3db5550382ac8b38e566347
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2470633Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816996}
parent bb737671
...@@ -197,7 +197,8 @@ PushMessagingAppIdentifier PushMessagingAppIdentifier::FindByServiceWorker( ...@@ -197,7 +197,8 @@ PushMessagingAppIdentifier PushMessagingAppIdentifier::FindByServiceWorker(
profile->GetPrefs()->GetDictionary(prefs::kPushMessagingAppIdentifierMap); profile->GetPrefs()->GetDictionary(prefs::kPushMessagingAppIdentifierMap);
for (auto it = base::DictionaryValue::Iterator(*map); !it.IsAtEnd(); for (auto it = base::DictionaryValue::Iterator(*map); !it.IsAtEnd();
it.Advance()) { it.Advance()) {
if (base::StartsWith(it.value().GetString(), base_pref_value, if (it.value().is_string() &&
base::StartsWith(it.value().GetString(), base_pref_value,
base::CompareCase::SENSITIVE)) base::CompareCase::SENSITIVE))
return FindByAppId(profile, it.key()); return FindByAppId(profile, it.key());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment