Fix Media editor when using double click the preview of added media (#752)

Fixes #10923
This commit is contained in:
Paul Culley 2019-01-05 19:11:12 -06:00 committed by Sam Manzi
parent 30628cf6c7
commit c7f2b19784

View File

@ -245,12 +245,13 @@ class EditMedia(EditPrimary):
self.view_media(obj)
def view_media(self, obj):
ref_obj = self.dbstate.db.get_media_from_handle(self.obj.handle)
if self.obj.handle:
ref_obj = self.dbstate.db.get_media_from_handle(self.obj.handle)
if ref_obj:
media_path = media_path_full(self.dbstate.db,
ref_obj.get_path())
open_file_with_default_application(media_path, self.uistate)
if ref_obj:
media_path = media_path_full(self.dbstate.db,
ref_obj.get_path())
open_file_with_default_application(media_path, self.uistate)
def select_file(self, val):
self.determine_mime()