From d74f2c05ffe3cb3d47ab20c45d7a4b8d8bff0726 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sun, 15 Mar 2015 21:53:46 +0000 Subject: [PATCH] Fix crash if presentation file in the mediamanger was removed bewteen sessions. Fixes bug 1432418. Fixes: https://launchpad.net/bugs/1432418 --- openlp/plugins/presentations/lib/mediaitem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 00a529b63..fa6b3d377 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -245,7 +245,8 @@ class PresentationMediaItem(MediaManagerItem): doc = self.controllers[cidx].add_document(filepath) if clean_for_update: 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() else: doc.presentation_deleted()