Fix crash risk on pkpass encoding

This commit is contained in:
Sylvia van Os
2026-01-15 18:14:55 +01:00
parent 442c7c28d4
commit d5b3796ae9

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) {