From 92a97ea4d969f630db0b127a30139e0f66a37219 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 7 Aug 2012 16:09:54 +0000 Subject: [PATCH] accounts::id2name() needs to return false, not throw an exception for not found accounts --- phpgwapi/inc/class.accounts.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index 835173d73e..07140d41f8 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -590,12 +590,16 @@ class accounts * * @param int $account_id numerica account_id * @param string $which='account_lid' type to convert to: account_lid (default), account_email, ... - * @return string/false converted value or false on error ($account_id not found) + * @return string|boolean converted value or false on error ($account_id not found) */ static function id2name($account_id, $which='account_lid') { - if (!($data = self::cache_read($account_id))) return false; - + try { + if (!($data = self::cache_read($account_id))) return false; + } + catch (Exception $e) { + return false; + } //echo "

accounts::id2name($account_id,$which)='{$data[$which]}'"; return $data[$which]; } @@ -997,6 +1001,7 @@ class accounts * * @param int $account_id * @return array + * @throws egw_exception_wrong_parameter if no integer was passed as $account_id */ static function cache_read($account_id) {