fix: avoid null pointer exception

This commit is contained in:
Björn Fromme
2025-02-25 09:58:08 +01:00
parent 000c42ecba
commit e0fffce621
@@ -47,6 +47,14 @@ class TravelinfoController extends ActionController
/** @var Date $date */
$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();
if (null === $product) {