do not access user data if user is not logged-in in SeminaryRoleController

This commit is contained in:
coderkun 2014-04-22 11:56:30 +02:00
commit fdf1e6e9bd

View file

@ -80,8 +80,11 @@
// Get Seminary and Character data // Get Seminary and Character data
try { try {
self::$seminary = $this->Seminaries->getSeminaryByUrl($this->request->getParam(3)); self::$seminary = $this->Seminaries->getSeminaryByUrl($this->request->getParam(3));
self::$user['seminaryroles'] = array_map(function($r) { return $r['name']; }, $this->Userseminaryroles->getUserseminaryrolesForUserById(self::$user['id'], self::$seminary['id'])); if(!is_null(self::$user))
self::$character = $this->Characters->getCharacterForUserAndSeminary(self::$user['id'], self::$seminary['id']); {
self::$user['seminaryroles'] = array_map(function($r) { return $r['name']; }, $this->Userseminaryroles->getUserseminaryrolesForUserById(self::$user['id'], self::$seminary['id']));
self::$character = $this->Characters->getCharacterForUserAndSeminary(self::$user['id'], self::$seminary['id']);
}
} }
catch(\nre\exceptions\IdNotFoundException $e) { catch(\nre\exceptions\IdNotFoundException $e) {
} }