diff --git a/recipes/nytimes.recipe b/recipes/nytimes.recipe index 8d984351ce..87c09c62d1 100644 --- a/recipes/nytimes.recipe +++ b/recipes/nytimes.recipe @@ -203,7 +203,7 @@ class NewYorkTimes(BasicNewsRecipe): m = pat.search(key) grouping, container, relation = map(int, m.groups()) asset = sdata['asset'] - if asset['typename'] == 'Article' and grouping == 0: + if asset and asset['typename'] == 'Article' and grouping == 0: if container not in sections: sections[container] = [] sections[container].append(asset['id'].split(':', 1)[1]) diff --git a/recipes/nytimes_sub.recipe b/recipes/nytimes_sub.recipe index 7c333152fd..ffdf42d62a 100644 --- a/recipes/nytimes_sub.recipe +++ b/recipes/nytimes_sub.recipe @@ -203,7 +203,7 @@ class NewYorkTimes(BasicNewsRecipe): m = pat.search(key) grouping, container, relation = map(int, m.groups()) asset = sdata['asset'] - if asset['typename'] == 'Article' and grouping == 0: + if asset and asset['typename'] == 'Article' and grouping == 0: if container not in sections: sections[container] = [] sections[container].append(asset['id'].split(':', 1)[1])