fix: avoid null pointer exceptions

This commit is contained in:
Björn Fromme
2025-12-10 12:54:19 +01:00
parent 7da398d553
commit 3d86bc48ef
4 changed files with 4 additions and 4 deletions
@@ -125,7 +125,7 @@ class City extends AbstractDestination implements TeaserInterface
{
$headerImages = $this->headerImages;
if ($headerImages->count() === 0) {
if ($headerImages->count() === 0 && null !== $this->getRegion()) {
$headerImages = $this->getRegion()->getHeaderImages();
}
@@ -696,7 +696,7 @@ class Hotel extends AbstractEntity implements TeaserInterface
{
$headerImages = $this->headerImages;
if ($headerImages->count() === 0) {
if ($headerImages->count() === 0 && null !== $this->getCity()) {
$headerImages = $this->getCity()->getHeaderImages();
}
@@ -858,7 +858,7 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
{
$headerImages = $this->headerImages;
if ($headerImages->count() === 0) {
if ($headerImages->count() === 0 && null !== $this->getRegion()) {
$headerImages = $this->getRegion()->getHeaderImages();
}
@@ -285,7 +285,7 @@ class Region extends AbstractDestination implements TeaserInterface
{
$headerImages = $this->headerImages;
if ($headerImages->count() === 0) {
if ($headerImages->count() === 0 && null !== $this->getCountry()) {
$headerImages = $this->getCountry()->getHeaderImages();
}