From 2770ef9718fb29110b6ab43ea6cffffa8cc4c27b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 6 Oct 2013 16:37:51 +0200 Subject: [PATCH] listFind throws NoResultException on no results --- classes/Profile_prefs.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/Profile_prefs.php b/classes/Profile_prefs.php index 8589485286..d7da8813e3 100644 --- a/classes/Profile_prefs.php +++ b/classes/Profile_prefs.php @@ -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()) {