Przeglądaj źródła

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

jherve 1 rok temu
rodzic
commit
7e74f488c9
1 zmienionych plików z 1 dodań i 0 usunięć
  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)