Avoid null pointer exception
This commit is contained in:
1 parent
4c34c691f5
commit
cb825dc0ed
1 file changed
+2
-2
@@ -87,8 +87,8 @@ class MapController extends ActionController
|
||||
foreach ($products as $product)
|
||||
{
|
||||
/** @var \EP\EpProducts\Domain\Model\Product $product */
|
||||
$hotel = reset($product->getHotels()->toArray());
|
||||
if (!$hotel->isShowAsTeaser()) {
|
||||
$hotel = $product->getHotels()->current();
|
||||
if (null === $hotel || false === $hotel->isShowAsTeaser()) {
|
||||
continue;
|
||||
}
|
||||
$markerData[] = [
|
||||
|
||||
Reference in new issue
Block a user