Fix crash when sending Pdf live.

This commit is contained in:
Tomas Groth 2016-01-12 21:14:04 +01:00
parent c8fd1b8338
commit cf7630d3e3

View File

@ -349,16 +349,17 @@ class MessageListener(object):
# When presenting PDF/XPS/OXPS, we are using the image presentation code, # When presenting PDF/XPS/OXPS, we are using the image presentation code,
# so handler & processor is set to None, and we skip adding the handler. # so handler & processor is set to None, and we skip adding the handler.
self.handler = None self.handler = None
if self.handler == self.media_item.automatic:
self.handler = self.media_item.find_controller_by_type(file)
if not self.handler:
return
else: else:
# the saved handler is not present so need to use one based on file suffix. if self.handler == self.media_item.automatic:
if not self.controllers[self.handler].available:
self.handler = self.media_item.find_controller_by_type(file) self.handler = self.media_item.find_controller_by_type(file)
if not self.handler: if not self.handler:
return return
else:
# the saved handler is not present so need to use one based on file suffix.
if not self.controllers[self.handler].available:
self.handler = self.media_item.find_controller_by_type(file)
if not self.handler:
return
if is_live: if is_live:
controller = self.live_handler controller = self.live_handler
else: else: