listFind throws NoResultException on no results

This commit is contained in:
Mikael Nordfeldth 2013-10-06 16:37:51 +02:00
parent fb94a16217
commit 2770ef9718

View 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()) {