Преглед на файлове

[fix] Handle the case when no "sibling" article exist in the storage

jherve преди 1 година
родител
ревизия
7e74f488c9
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      src/de_quoi_parle_le_monde/web.py

+ 1 - 0
src/de_quoi_parle_le_monde/web.py

@@ -41,6 +41,7 @@ async def site_main_article_snapshot(
         return min(
             [a for a in after_before_articles if cond_fun(a)],
             key=lambda a: abs(a["time_diff"]),
+            default=None,
         )
 
     main_articles = await storage.list_neighbouring_main_articles(id, snapshot_id)