Shout: One more place to catch empty arrays
authorBen Klang <ben@alkaloid.net>
Fri, 2 Apr 2010 22:34:27 +0000 (18:34 -0400)
committerBen Klang <ben@alkaloid.net>
Fri, 2 Apr 2010 22:34:27 +0000 (18:34 -0400)
shout/lib/Ajax/Application.php

index 5cecd5f..10ed5e7 100644 (file)
@@ -111,7 +111,12 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base
             $vars = $this->_vars;
             $shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
             $account = $_SESSION['shout']['curaccount']['code'];
-            return $shout->devices->getDevices($account);
+            $devices = $shout->devices->getDevices($account);
+            if (empty($devices)) {
+                return false;
+            } else {
+                return $devices;
+            }
         } catch (Exception $e) {
             //FIXME: Create a way to notify the user of the failure.
             Horde::logMessage($e, 'ERR');