Skip to content

Commit 157cfc8

Browse files
committed
Fix crash on iOS 26 when converting some NSError instances to ErrorCode
Some NSError values, when converted to ErrorCode using ErrorCode(_nsError:), cause a crash on iOS 26 — even if they represent known error codes like .SCPErrorCanceled. This does not occur on iOS 18.5 (including simulators), where the same code executes without issue. Crashes occur inconsistently across error codes and are triggered during logging or property access (e.g. print(errorCode.code)), with messages like: Fatal error: Unknown error at SignalCompression/SignalEncoder.swift. This commit avoids triggering such conversions/logging that may crash on iOS 26.
1 parent 805a719 commit 157cfc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/Sources/Hardware/CardReader/StripeCardReader/StripeCardReaderService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ private extension StripeCardReaderService {
11091109
DDLogError("💳 Card Reader Config Error: \(error)")
11101110
default:
11111111
let errorCode = ErrorCode(_nsError: error as NSError)
1112-
DDLogError("💳 Stripe Error Code: \(errorCode.code)")
1112+
DDLogError("💳 Stripe Error Code: \(errorCode.errorCode)")
11131113
}
11141114
return UnderlyingError(with: error)
11151115
}

0 commit comments

Comments
 (0)