Explorar el Código

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

master
Gitea hace 1 año
padre
commit
af97f570ab
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      mymastotag.py

+ 1
- 1
mymastotag.py Ver fichero

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)

Loading…
Cancelar
Guardar