From f6bfce832e228b9a10755fa7862727de539c310b Mon Sep 17 00:00:00 2001 From: JoshuaLicense Date: Tue, 28 May 2024 12:55:04 +0100 Subject: [PATCH] fix: fix count by `null` in `TransferVehicleController` (#159) --- .../Controller/Licence/Vehicle/TransferVehicleController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/Olcs/src/Controller/Licence/Vehicle/TransferVehicleController.php b/module/Olcs/src/Controller/Licence/Vehicle/TransferVehicleController.php index 01a08c39f..9280b1122 100644 --- a/module/Olcs/src/Controller/Licence/Vehicle/TransferVehicleController.php +++ b/module/Olcs/src/Controller/Licence/Vehicle/TransferVehicleController.php @@ -107,8 +107,7 @@ public function postAction() $validationErrors = []; if (empty($selectedVehicles)) { $validationErrors[] = 'licence.vehicle.transfer.error.no-vehicle-selected'; - } - if (count($selectedVehicles) > static::VEHICLE_TRANSFER_LIMIT) { + } elseif (count($selectedVehicles) > static::VEHICLE_TRANSFER_LIMIT) { $validationErrors[] = 'licence.vehicle.transfer.error.too-many-vehicles-selected'; }