Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit 36c7525

Browse files
Fix bug when checking for existing session on empty lifetime
1 parent 152f229 commit 36c7525

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Entity/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public function setLifetime(?Lifetime $lifetime = null)
409409
{
410410
$this->lifetime = $lifetime;
411411

412-
if (!$this->lifetime->getSessions()->contains($this)) {
412+
if ($lifetime instanceof Lifetime && !$this->lifetime->getSessions()->contains($this)) {
413413
$this->lifetime->addSession($this);
414414
}
415415

0 commit comments

Comments
 (0)