Skip to content

Commit

Permalink
[BUGFIX] Prevent exception on tracked links when user is deleted or d…
Browse files Browse the repository at this point in the history
…isabled

Fixes #210
  • Loading branch information
einpraegsam committed Feb 7, 2024
1 parent a788a3e commit d59c323
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Classes/Domain/Service/LogService.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ public function logNewsletterOpening(Newsletter $newsletter, User $user): void
*/
public function logLinkOpening(Link $link): void
{
$this->logNewsletterOpening($link->getNewsletter(), $link->getUser());
$this->log($link->getNewsletter(), $link->getUser(), Log::STATUS_LINKOPENING, ['target' => $link->getTarget()]);
if ($link->getUser() !== null) {
$this->logNewsletterOpening($link->getNewsletter(), $link->getUser());
$this->log($link->getNewsletter(), $link->getUser(), Log::STATUS_LINKOPENING, ['target' => $link->getTarget()]);
}
}

/**
Expand Down

0 comments on commit d59c323

Please sign in to comment.