From 17e64a08aec63026b738af5d779185aad2433bb7 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sat, 27 Apr 2019 18:22:16 +0200 Subject: [PATCH] Fixed barcode legacy bug --- src/pass.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pass.js b/src/pass.js index b6a57af..f169fc6 100644 --- a/src/pass.js +++ b/src/pass.js @@ -391,9 +391,9 @@ class Pass { // PKBarcodeFormatCode128 gets chosen automatically // if it is the first. If true, we'll get 1 // (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]; }