mirror of
https://github.com/retailcrm/Fetch.git
synced 2025-02-06 02:39:21 +03:00
Merge pull request #137 from tomsommer/patch-1
Fix case where imap_fetch_overview() fails and returns empty array
This commit is contained in:
commit
22ae7258c2
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user