浏览代码

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

master
Gitea 2 年前
父节点
当前提交
af97f570ab
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      mymastotag.py

+ 1
- 1
mymastotag.py 查看文件

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

正在加载...
取消
保存