Catch unserialization error.
authorJan Schneider <jan@horde.org>
Fri, 12 Mar 2010 16:06:42 +0000 (17:06 +0100)
committerJan Schneider <jan@horde.org>
Fri, 12 Mar 2010 16:06:42 +0000 (17:06 +0100)
horde/lib/Block/twitter_timeline.php

index 2bd4cca..56d37c4 100644 (file)
@@ -130,7 +130,9 @@ class Horde_Block_Horde_twitter_timeline extends Horde_Block
             $stream = Horde_Serialize::unserialize($twitter->statuses->friendsTimeline(), Horde_Serialize::JSON);
         } catch (Horde_Service_Twitter_Exception $e) {
             $msg = Horde_Serialize::unserialize($e->getMessage(), Horde_Serialize::JSON);
-            return sprintf(_("There was an error contacting Twitter: %s"), $msg->error);
+            return $msg
+                ? sprintf(_("There was an error contacting Twitter: %s"), $msg->error)
+                : _("There was an error contacting Twitter.");
         }
         /* Latest status */
         if (empty($this->_profile->status)) {