Fix crash on pkpass with no barcodes

This commit is contained in:
Sylvia van Os
2025-05-12 19:33:28 +02:00
parent e12204771f
commit caeba57a42
4 changed files with 161 additions and 1 deletions

View File

@@ -34,7 +34,10 @@ class PkpassParser(context: Context, uri: Uri?) {
private var expiry: Date? = null
private val balance: BigDecimal = BigDecimal(0)
private val balanceType: Currency? = null
private var cardId: String? = null
// FIXME: Some cards may not have any barcodes, but Catima doesn't accept null card ID
// An empty string card ID would prevent a crash, but would be blocked in the edit activity
// Setting the default to the "No barcode" text at least prevents a crash, but it is definitely a hack
private var cardId: String = context.getString(R.string.noBarcode)
private var barcodeId: String? = null
private var barcodeType: CatimaBarcode? = null
private var headerColor: Int? = null