Commit bb367f10 authored by khmel@chromium.org's avatar khmel@chromium.org Committed by Commit Bot

arc: Prevent NOTREACHED from arc_app_list_prefs in logs.

Some user feedbacks are overflown this message. This happens after
adding "arc.apps.default" prefs. "default" appeared in arc.apps listing.
Fix to check if this is valid crx id as it done in different places of
this file.

TEST=Manually
BUG=b/117566030

Change-Id: I79384e58ab31593f571b2ce4542dfbfbc3d2447f
Reviewed-on: https://chromium-review.googlesource.com/c/1289992Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600962}
parent 1d8462ad
......@@ -1389,6 +1389,9 @@ std::unordered_set<std::string> ArcAppListPrefs::GetAppsAndShortcutsForPackage(
prefs_->GetDictionary(arc::prefs::kArcApps);
for (base::DictionaryValue::Iterator app_it(*apps); !app_it.IsAtEnd();
app_it.Advance()) {
if (!crx_file::id_util::IdIsValid(app_it.key()))
continue;
const base::Value* value = &app_it.value();
const base::DictionaryValue* app;
if (!value->GetAsDictionary(&app)) {
......@@ -1398,7 +1401,7 @@ std::unordered_set<std::string> ArcAppListPrefs::GetAppsAndShortcutsForPackage(
std::string app_package;
if (!app->GetString(kPackageName, &app_package)) {
NOTREACHED();
LOG(ERROR) << "App is malformed: " << app_it.key();
continue;
}
......
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