fix: avoid null pointer exceptions

This commit is contained in:
Björn Fromme committed 2025-12-10 12:54:19 +01:00
1 parent 7da398d553
commit 3d86bc48ef
4 files changed
+4 -4

No files matched your search

@@ -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();
}