From 6e009e57251bd8c4997abde84fff20d199420f7c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 7 Jul 2009 15:21:04 -0600 Subject: [PATCH] Better error handling for mailbox lists --- imp/lib/Contents.php | 7 ++++++- imp/message.php | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 1e8fc497e..4dbeb3cc3 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -129,10 +129,15 @@ class IMP_Contents $ret = $GLOBALS['imp_imap']->ob->fetch($this->_mailbox, array( Horde_Imap_Client::FETCH_STRUCTURE => array('parse' => true) ), array('ids' => array($this->_index))); - $this->_message = $ret[$this->_index]['structure']; } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Exception('Error displaying message.'); } + + if (!isset($ret[$this->_index]['structure'])) { + throw new Horde_Exception('Error displaying message.'); + } + + $this->_message = $ret[$this->_index]['structure']; } } diff --git a/imp/message.php b/imp/message.php index 0733b3087..6c1c8e81d 100644 --- a/imp/message.php +++ b/imp/message.php @@ -202,6 +202,7 @@ $mailbox_name = $index_array['mailbox']; try { $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name); } catch (Horde_Exception $e) { + $imp_mailbox->removeMsgs(true); _returnToMailbox(null, 'message_missing'); require IMP_BASE . '/mailbox.php'; exit; -- 2.11.0