瀏覽代碼

Don't crash when post has no media (d'Oh)

master
Gitea 1 年之前
父節點
當前提交
af97f570ab
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      mymastotag.py

+ 1
- 1
mymastotag.py 查看文件

@@ -27,7 +27,7 @@ def my_masto_tag(lang, instance, user, tag):
27 27
         e['description'] = str(soup)
28 28
         images = []
29 29
         videos =[]
30
-        for m in e['media_content']:
30
+        for m in e.get('media_content', []):
31 31
             mtype = m['type'].split('/')[0]
32 32
             if mtype=='image':
33 33
                 images.append(m)

Loading…
取消
儲存