openfoodfacts / power-user-script

User script for your browser, to empower Open Food Facts contribution
GNU Affero General Public License v3.0
12 stars 5 forks source link

Bugfix: Not all barcodes are being drawn JsBarcode. #81

Closed DanieliusAsm closed 7 months ago

DanieliusAsm commented 7 months ago

What

When you want to show barcodes (shift+b) JSBarcode sometimes throws an error similar to

"2000000148223" is not a valid input for e

Since the barcodes are being drawn inside a for loop one by one, eventually an exeption occurs and quits the for loop leaving the remaining barcodes not drawn:

Screenshot

image

All I do is add a try{}catch(){} block. I dont fix the error itself. I am guessing the barcode is not a valid format therefore it is not being drawn by JsBarcode.