浏览代码

[books] Fix no result for detail lookup

Colin Powell 2 月之前
父节点
当前提交
8c600d6b4b
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      vrobbler/apps/books/sources/semantic.py

+ 3 - 0
vrobbler/apps/books/sources/semantic.py

@@ -38,6 +38,9 @@ def lookup_paper_from_semantic(title: str) -> dict:
 
     result = json.loads(response.content)
 
+    if not result:
+        return paper_dict
+
     page_str = result.get("journal", {}).get("pages")
     if page_str:
         try: