diff --git a/app/src/main/java/protect/card_locker/CatimaBarcode.java b/app/src/main/java/protect/card_locker/CatimaBarcode.java index 91301353d..59a1d5305 100644 --- a/app/src/main/java/protect/card_locker/CatimaBarcode.java +++ b/app/src/main/java/protect/card_locker/CatimaBarcode.java @@ -72,6 +72,12 @@ public class CatimaBarcode { } public String prettyName() { - return barcodePrettyNames.get(barcodeFormats.indexOf(mBarcodeFormat)); + int index = barcodeFormats.indexOf(mBarcodeFormat); + + if (index == -1 || index >= barcodePrettyNames.size()) { + return mBarcodeFormat.name(); + } + + return barcodePrettyNames.get(index); } }