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
1 changed files with 7 additions and 6 deletions

View File

@ -349,16 +349,17 @@ class MessageListener(object):
# 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.
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:
# the saved handler is not present so need to use one based on file suffix.
if not self.controllers[self.handler].available:
if self.handler == self.media_item.automatic:
self.handler = self.media_item.find_controller_by_type(file)
if not self.handler:
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:
controller = self.live_handler
else: