From 62f294d83902d2302d5a5a1a704713028024ed89 Mon Sep 17 00:00:00 2001 From: Benoit VIGNAL Date: Mon, 26 Feb 2024 20:11:34 +0100 Subject: [PATCH] Fix missing check --- src/Controller/MemberPresenceToday.php | 2 +- src/EventSubscriber/Doctrine/MemberSubscriber.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/MemberPresenceToday.php b/src/Controller/MemberPresenceToday.php index 75d238f..099cc3e 100644 --- a/src/Controller/MemberPresenceToday.php +++ b/src/Controller/MemberPresenceToday.php @@ -15,7 +15,7 @@ public function __invoke(Request $request, MemberPresenceRepository $memberPrese $todayPresentMembers = $memberPresenceRepository->findAllPresentToday(); $controlShootingActivity = $globalSettingService->getSettingValue(GlobalSetting::CONTROL_SHOOTING_ACTIVITY_ID); - if ($controlShootingActivity) { + if ($controlShootingActivity && is_numeric($controlShootingActivity)) { $controlShootingActivity = $activityRepository->find($controlShootingActivity); if ($controlShootingActivity) { foreach ($todayPresentMembers as $memberPresence) { diff --git a/src/EventSubscriber/Doctrine/MemberSubscriber.php b/src/EventSubscriber/Doctrine/MemberSubscriber.php index e8bfc7d..64a74df 100644 --- a/src/EventSubscriber/Doctrine/MemberSubscriber.php +++ b/src/EventSubscriber/Doctrine/MemberSubscriber.php @@ -36,7 +36,7 @@ public function postLoad(Member $member, PostLoadEventArgs $args): void { } $controlShootingActivity = $this->globalSettingService->getSettingValue(GlobalSetting::CONTROL_SHOOTING_ACTIVITY_ID); - if ($controlShootingActivity) { + if ($controlShootingActivity && is_numeric($controlShootingActivity)) { $controlShootingActivity = $this->activityRepository->find($controlShootingActivity); if ($controlShootingActivity) { $presence = $this->memberPresenceRepository->findLastOneByActivity($member, $controlShootingActivity);