Index: components/ntp_snippets/ntp_snippets_fetcher.cc |
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.cc b/components/ntp_snippets/ntp_snippets_fetcher.cc |
index c0018e7d816ad650ff06f25bdf664b5b64034e2e..8c75df86219eb15f78ed348af1226db462b3a64c 100644 |
--- a/components/ntp_snippets/ntp_snippets_fetcher.cc |
+++ b/components/ntp_snippets/ntp_snippets_fetcher.cc |
@@ -540,12 +540,14 @@ bool NTPSnippetsFetcher::JsonToSnippets(const base::Value& parsed, |
const base::ListValue* suggestions = nullptr; |
Marc Treib
2016/08/25 09:14:02
nit: Move this down to where it's used.
sfiera
2016/08/25 10:24:29
Done.
|
if (!(v->GetAsDictionary(&category_value) && |
category_value->GetInteger("id", &category_id) && |
- (category_id > 0) && |
- category_value->GetList("suggestions", &suggestions))) { |
+ (category_id > 0))) { |
return false; |
} |
Category category = category_factory_->FromRemoteCategory(category_id); |
NTPSnippet::PtrVector* articles = &(*snippets)[category]; |
+ if (!category_value->GetList("suggestions", &suggestions)) { |
tschumann
2016/08/24 21:35:22
let's document this case, e.g.,
// Categories are
Marc Treib
2016/08/25 09:14:02
+1 for comment
sfiera
2016/08/25 10:24:29
Done.
|
+ continue; |
+ } |
if (!AddSnippetsFromListValue( |
/* content_suggestions_api = */ true, *suggestions, articles)) { |
return false; |