Commit f7dccf17 authored by Thomas Löffler's avatar Thomas Löffler

Add checks for existing ObjectStorage before add and remove items

parent a300c4ba
Pipeline #7109 passed with stages
in 2 minutes and 45 seconds
......@@ -84,11 +84,17 @@ class FrontendUser extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
public function addNotifiedExtension(Extension $extension): void
{
if ($this->notifiedExtensions === null) {
$this->notifiedExtensions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}
$this->notifiedExtensions->attach($extension);
}
public function removeNotifiedExtension(Extension $extension): void
{
if ($this->notifiedExtensions === null) {
$this->notifiedExtensions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}
$this->notifiedExtensions->detach($extension);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment