fix: avoid null pointer exception
This commit is contained in:
@@ -47,6 +47,14 @@ class TravelinfoController extends ActionController
|
|||||||
/** @var Date $date */
|
/** @var Date $date */
|
||||||
$date = $this->dateRepository->findOneByCode($travelCodeDate);
|
$date = $this->dateRepository->findOneByCode($travelCodeDate);
|
||||||
|
|
||||||
|
if (null === $date) {
|
||||||
|
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
|
||||||
|
$GLOBALS['TYPO3_REQUEST'],
|
||||||
|
'Termin nicht gefunden'
|
||||||
|
);
|
||||||
|
throw new ImmediateResponseException($response, 1731071856);
|
||||||
|
}
|
||||||
|
|
||||||
$product = $date->getProduct();
|
$product = $date->getProduct();
|
||||||
|
|
||||||
if (null === $product) {
|
if (null === $product) {
|
||||||
|
|||||||
Reference in New Issue
Block a user