Fix crash if presentation file in the mediamanger was removed bewteen sessions. Fixes bug 1432418.

Fixes: https://launchpad.net/bugs/1432418
This commit is contained in:
Tomas Groth 2015-03-15 21:53:46 +00:00
parent affd6f0d85
commit d74f2c05ff

View File

@ -245,7 +245,8 @@ class PresentationMediaItem(MediaManagerItem):
doc = self.controllers[cidx].add_document(filepath) doc = self.controllers[cidx].add_document(filepath)
if clean_for_update: if clean_for_update:
thumb_path = doc.get_thumbnail_path(1, True) thumb_path = doc.get_thumbnail_path(1, True)
if not thumb_path or os.path.getmtime(thumb_path) < os.path.getmtime(filepath): if not thumb_path or (os.path.exists(filepath)
and os.path.getmtime(thumb_path) < os.path.getmtime(filepath)):
doc.presentation_deleted() doc.presentation_deleted()
else: else:
doc.presentation_deleted() doc.presentation_deleted()