diff --git a/backend/app/Core/Flows/DriverRegistrationFlow.php b/backend/app/Core/Flows/DriverRegistrationFlow.php index 3b66250..377dd78 100644 --- a/backend/app/Core/Flows/DriverRegistrationFlow.php +++ b/backend/app/Core/Flows/DriverRegistrationFlow.php @@ -398,8 +398,8 @@ class DriverRegistrationFlow extends BaseFlow } $ocrData = json_decode($rawOcr, true); - if (!$ocrData || (empty($ocrData[$requiredJsonKey]) && !array_key_exists($requiredJsonKey, $ocrData))) { - error_log("[DriverRegistrationFlow] Missing required key '$requiredJsonKey' in OCR response: " . $rawOcr); + if (!$ocrData || empty($ocrData[$requiredJsonKey])) { + error_log("[DriverRegistrationFlow] Missing or empty required key '$requiredJsonKey' in OCR response: " . $rawOcr); return new FlowResult($failMessage, $step); }