Skip to content

Commit

Permalink
Throw exception if no user is authenticated and userId is null
Browse files Browse the repository at this point in the history
  • Loading branch information
xemlock committed Mar 12, 2019
1 parent 5ae8416 commit 0a22570
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/ManipleUser/UserSettings/Service.php
Expand Up @@ -75,6 +75,9 @@ protected function _getUserId($user)
{
if ($user === null) {
$userId = $this->_securityContext->getIdentity();
if (empty($userId)) {
throw new Exception('No user is authenticated');
}
} elseif ($user instanceof ModUser_Model_UserInterface) {
$userId = $user->getId();
} else {
Expand Down

0 comments on commit 0a22570

Please sign in to comment.