Bläddra i källkod

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

master
Gitea 3 år sedan
förälder
incheckning
af97f570ab
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1
    1
      mymastotag.py

+ 1
- 1
mymastotag.py Visa fil

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)

Laddar…
Avbryt
Spara