From c09ffb3567abb8b3b357b86c6ad1657ce9b75c44 Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Thu, 30 Oct 2014 09:45:40 -0400 Subject: [PATCH] Bug: 13653 Sanity check that we have a valid MIME part. --- imp/lib/Contents.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 43590d89d8b..9b0235db23d 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -1122,6 +1122,9 @@ public function canDisplay($part, $mask, $type = null) if (!is_object($part)) { $part = $this->getMIMEPart($part, array('nocontents' => true)); } + if (!$part) { + return 0; + } $viewer = $GLOBALS['injector']->getInstance('IMP_Factory_MimeViewer')->create($part, array('contents' => $this, 'type' => $type)); if ($mask & self::RENDER_INLINE_AUTO) {