CC-3693: Uninstalling + Reinstall of Airtime + refreshing the page as a non-existant user causes a stack trace.

-Fixed
This commit is contained in:
Martin Konecny 2012-04-20 13:11:28 -04:00
parent 7d6e251adf
commit 5aa2339a1d
1 changed files with 9 additions and 2 deletions

View File

@ -295,11 +295,18 @@ class Application_Model_User {
public static function GetCurrentUser() {
$userinfo = Zend_Auth::getInstance()->getStorage()->read();
if (is_null($userinfo)){
return null;
} else {
return new self($userinfo->id);
try {
return new self($userinfo->id);
} catch (Exception $e){
//we get here if $userinfo->id is defined, but doesn't exist
//in the database anymore.
Zend_Auth::getInstance()->clearIdentity();
return null;
}
}
}
}