Browse Source

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

master
Gitea 1 year ago
parent
commit
af97f570ab
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      mymastotag.py

+ 1
- 1
mymastotag.py View File

@@ -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…
Cancel
Save