no need to call accounts class, if we have no id

This commit is contained in:
Ralf Becker 2016-08-24 19:43:01 +02:00
parent 81dd3cc41f
commit c3f1e887c5
2 changed files with 2 additions and 2 deletions

View File

@ -786,7 +786,7 @@ class Accounts
*/
function exists($account_id)
{
if (!($data = $this->read($account_id)))
if (!$account_id || !($data = $this->read($account_id)))
{
return 0;
}

View File

@ -304,7 +304,7 @@ function get_account_id($account_id = '',$default_id = '')
}
elseif (is_string($account_id))
{
if($GLOBALS['egw']->accounts->exists((int)$account_id) == True)
if((int)$account_id && $GLOBALS['egw']->accounts->exists((int)$account_id) == True)
{
return (int)$account_id;
}