]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
listFind throws NoResultException on no results
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Oct 2013 14:37:51 +0000 (16:37 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Oct 2013 14:37:51 +0000 (16:37 +0200)
classes/Profile_prefs.php

index 85894852864bd5ad3568e35bc8e0a68591c3d18e..d7da8813e313dbdcf88228ca5879d2a5e772bdfc 100644 (file)
@@ -84,7 +84,11 @@ class Profile_prefs extends Managed_DataObject
 
     static function getAll(Profile $profile)
     {
-        $prefs = self::listFind('profile_id', $profile->id);
+        try {
+            $prefs = self::listFind('profile_id', $profile->id);
+        } catch (NoResultException $e) {
+            return array();
+        }
 
         $list = array();
         while ($entry = $prefs->fetch()) {