Controller::API() returns null on error, so we can return 404 instead of 500.

This commit is contained in:
NH Gooi
2025-03-19 22:18:22 +01:00
parent 3e7490531d
commit aec6690c9e
2 changed files with 7 additions and 3 deletions

View File

@@ -49,7 +49,10 @@ class RadioController extends Controller
public function program($id)
{
$apiResult = $this->API('programma/details/' . (int)$id);
$apiResult = $this->API('programma/details/' . (int)$id);
if($apiResult == null) {
return abort(404);
}
return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
}