From 410f7e920bb706e50e73577c3b424fd59e21d789 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 21 Apr 2016 17:19:37 +0200 Subject: [PATCH] test video length --- app/festival/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/festival/models.py b/app/festival/models.py index 72267631..17fa9282 100644 --- a/app/festival/models.py +++ b/app/festival/models.py @@ -144,8 +144,9 @@ class Media(Displayable, RichText): elif self.closed_source_mime_type in source.attrib['type']: self.closed_source_url = source.attrib['src'] video = self.q('video') - if 'poster' in video[0].attrib.keys(): - self.poster_url = video[0].attrib['poster'] + if len(video): + if 'poster' in video[0].attrib.keys(): + self.poster_url = video[0].attrib['poster'] class Audio(Media): -- 2.39.5