소스 검색

[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)