From 9ce7b9571a0347186970aff44b1f5ccd0a839311 Mon Sep 17 00:00:00 2001 From: Schwifty Date: Mon, 23 Mar 2026 03:22:23 +0000 Subject: [PATCH] fix: allow minor = 0 in allocateMinor response validation --- PayfritBeacon/Services/APIClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PayfritBeacon/Services/APIClient.swift b/PayfritBeacon/Services/APIClient.swift index 7bea61e..4a74986 100644 --- a/PayfritBeacon/Services/APIClient.swift +++ b/PayfritBeacon/Services/APIClient.swift @@ -201,8 +201,8 @@ actor APIClient { guard resp.OK else { throw APIError.serverError(resp.MESSAGE ?? resp.ERROR ?? "Failed to allocate minor") } - guard let minor = resp.BeaconMinor, minor > 0 else { - throw APIError.serverError("API returned invalid minor value: \(resp.BeaconMinor ?? 0). Service point may not be configured correctly.") + guard let minor = resp.BeaconMinor, minor >= 0 else { + throw APIError.serverError("API returned invalid minor value: \(resp.BeaconMinor.map(String.init) ?? "nil"). Service point may not be configured correctly.") } return minor }