diff --git a/backend/app/Controllers/ElementController.php b/backend/app/Controllers/ElementController.php index 7d23213..9e61720 100644 --- a/backend/app/Controllers/ElementController.php +++ b/backend/app/Controllers/ElementController.php @@ -14,6 +14,11 @@ class ElementController public function show(int $id): JsonResponse { $element = $this->elementRepository->find($id); + if ($element === null) { + return new JsonResponse([ + 'error' => 'Element not found', + ], 404); + } return new JsonResponse([ 'element' => [