Merge pull request #137 from tomsommer/patch-1

Fix case where imap_fetch_overview() fails and returns empty array
This commit is contained in:
Robert Hafner 2015-07-09 14:18:46 -07:00
commit 22ae7258c2

View File

@ -289,6 +289,9 @@ class Message
if ($forceReload || !isset($this->messageOverview)) {
// returns an array, and since we just want one message we can grab the only result
$results = imap_fetch_overview($this->imapStream, $this->uid, FT_UID);
if ( sizeof($results) == 0 ) {
throw new \RuntimeException('Error fetching overview');
}
$this->messageOverview = array_shift($results);
if ( ! isset($this->messageOverview->date)) {
$this->messageOverview->date = null;