JsBarcode
JsBarcode copied to clipboard
Uncaught TypeError When Reading Undefined Text
As of version 3.5.9, the following line generates an uncaught type error when attempting to read the undefined text
:
https://github.com/lindell/JsBarcode/blob/master/dist/JsBarcode.all.js#L190
The following minimal example from CodePen will work with 3.5.8 but not on or after 3.5.9:
const api = JsBarcode("#barcode");
api["CODE128"]("Hello");
api.blank(20);
api["CODE128"]("World");
api.render();
In contrast explicitly passing the text does render:
const api = JsBarcode("#barcode");
api["CODE128"]("Hello", { text: "Hello" });
api.blank(20);
api["CODE128"]("World", { text: "World" });
api.render();
Thanks for an excellent bug report! I will take look at this as soon as I have the time.