mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-03-30 21:31:50 -04:00
Fix possible crash
I don't think this should ever happen, unless someone manually edited their import or DB, but this crash was logged in Google Play Console anyway so...
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user