Fix the webpage CRASH problem when the database has no article or when something bad happened on loading articles.

Alpha-snapshot20240618
Lan Hui 2026-03-12 16:00:53 +08:00
parent c9bbf6b6a3
commit 6285581bb5
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ def get_today_article(user_word_list, visited_articles):
text_level = text_difficulty_level(d['text'], d3) text_level = text_difficulty_level(d['text'], d3)
result_of_generate_article = "found" result_of_generate_article = "found"
today_article = None today_article = {}
if d: if d:
oxford_words = load_oxford_words(oxford_words_path) oxford_words = load_oxford_words(oxford_words_path)
oxford_word_count, total_words = count_oxford_words(d['text'],oxford_words) oxford_word_count, total_words = count_oxford_words(d['text'],oxford_words)