diff --git a/app/src/main/java/protect/card_locker/PkpassParser.kt b/app/src/main/java/protect/card_locker/PkpassParser.kt index 27f006f71..639479a75 100644 --- a/app/src/main/java/protect/card_locker/PkpassParser.kt +++ b/app/src/main/java/protect/card_locker/PkpassParser.kt @@ -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) {