Merge pull request #2963 from CatimaLoyalty/fix/pkpassEncodingCrashSafety

Fix crash risk on pkpass encoding
This commit is contained in:
Sylvia van Os
2026-01-15 20:43:32 +01:00
committed by GitHub

View File

@@ -354,7 +354,11 @@ class PkpassParser(context: Context, uri: Uri?) {
barcodeId = null
}
barcodeEncoding = Charset.forName(barcodeInfo.getString("messageEncoding"))
try {
barcodeEncoding = Charset.forName(barcodeInfo.getString("messageEncoding"))
} catch (ignored: Exception) {
// If encoding is not defined, null or otherwise invalid, stick to the default
}
// Don't set barcodeId if it's the same as cardId
if (cardId == barcodeId) {