Prevent erroring out in some cases of checking video metadata
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 14 Jul 2016 15:48:28 +0000 (10:48 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 14 Jul 2016 15:48:28 +0000 (10:48 -0500)
mediagoblin/media_types/video/models.py

index 4742b3427d6d4f9cc04a515b5f7141435192ff0a..da635ed7b1eef4bc1e9df4d25ef1ace0c8d7a9fe 100644 (file)
@@ -69,7 +69,7 @@ class VideoData(Base):
         orig_metadata = self.orig_metadata or {}
 
         if ("webm_video" not in self.get_media_entry.media_files
-           and "mimetype" in orig_metadata['common']['tags']
+           and "mimetype" in orig_metadata.get('common', {}).get('tags', {})
            and "codec" in orig_metadata['audio']
            and "codec" in orig_metadata['video']):
             if orig_metadata['mimetype'] == 'application/ogg':