fix: allow minor = 0 in allocateMinor response validation

This commit is contained in:
Schwifty 2026-03-23 03:22:23 +00:00
parent 734a18356f
commit 9ce7b9571a

View file

@ -201,8 +201,8 @@ actor APIClient {
guard resp.OK else { guard resp.OK else {
throw APIError.serverError(resp.MESSAGE ?? resp.ERROR ?? "Failed to allocate minor") throw APIError.serverError(resp.MESSAGE ?? resp.ERROR ?? "Failed to allocate minor")
} }
guard let minor = resp.BeaconMinor, minor > 0 else { 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.") throw APIError.serverError("API returned invalid minor value: \(resp.BeaconMinor.map(String.init) ?? "nil"). Service point may not be configured correctly.")
} }
return minor return minor
} }