Skip to content

Commit

Permalink
Merge pull request #57 from max-kovpak/patch-1
Browse files Browse the repository at this point in the history
Update AuditSubscriber.php
  • Loading branch information
l3pp4rd authored Jul 29, 2019
2 parents aacbc16 + 6227c3f commit 06b8618
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataDog/AuditBundle/EventSubscriber/AuditSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,11 @@ protected function value(EntityManager $em, Type $type, $value)

protected function blame(EntityManager $em)
{
if ($this->blameUser instanceof UserInterface) {
if ($this->blameUser instanceof UserInterface && \method_exists($this->blameUser, 'getId')) {
return $this->assoc($em, $this->blameUser);
}
$token = $this->securityTokenStorage->getToken();
if ($token && $token->getUser() instanceof UserInterface) {
if ($token && $token->getUser() instanceof UserInterface && \method_exists($token->getUser(), 'getId')) {
return $this->assoc($em, $token->getUser());
}
return null;
Expand Down

0 comments on commit 06b8618

Please sign in to comment.