Fixed barcode legacy bug

This commit is contained in:
Alexander Cerutti
2019-04-27 18:22:16 +02:00
parent 3338ff7b8f
commit 17e64a08ae

View File

@@ -391,9 +391,9 @@ class Pass {
// PKBarcodeFormatCode128 gets chosen automatically // PKBarcodeFormatCode128 gets chosen automatically
// if it is the first. If true, we'll get 1 // if it is the first. If true, we'll get 1
// (so not the first index) // (so not the first index)
let barcodeFirstValidIndex = Number(valid[0].format === "PKBarcodeFormatCode128"); const barcodeFirstValidIndex = Number(valid[0].format === "PKBarcodeFormatCode128");
if (valid.length > 1) { if (valid.length > 0) {
this._props["barcode"] = valid[barcodeFirstValidIndex]; this._props["barcode"] = valid[barcodeFirstValidIndex];
} }