resolve missing key error in write_html load_links, issue #23

This commit is contained in:
libertysoft3 2020-07-18 12:02:09 -07:00
parent 0f96e04083
commit 5fd67603e5

View file

@ -620,7 +620,7 @@ def load_links(date, subreddit, with_comments=False):
with open(daily_links_path, 'r', encoding='utf-8') as links_file:
reader = csv.DictReader(links_file)
for link_row in reader:
if with_comments:
if with_comments and 'id' in link_row.keys():
comments = []
comments_file_path = daily_path + '/' + link_row['id'] + '.csv'
if os.path.isfile(comments_file_path):