lib/kolab_sync_data_email.php

Aleksander Machniak machniak at kolabsys.com
Thu Nov 6 14:06:33 CET 2014


 lib/kolab_sync_data_email.php |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d880f3b571020adfcefe22050cd17411fa785af7
Author: Aleksander Machniak <alec at alec.pl>
Date:   Thu Nov 6 14:04:59 2014 +0100

    Correctly throw exception when fetching non-existent email message (#3579)
    Otherwise we hit PHP fatal error which effectively stops synchronization.

diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
index 381c3cf..8c3a820 100644
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -124,9 +124,9 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
     {
         $message = $this->getObject($serverId);
 
-        if (empty($message)) {
-            // @TODO: exception
-            return;
+        // error (message doesn't exist?)
+        if (empty($message) || empty($message->headers)) {
+            throw new Syncroton_Exception_NotFound("Message $serverId not found");
         }
 
         $msg     = $this->parseMessageId($serverId);




More information about the commits mailing list