You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const getBarcodeTypes = (formatsString) => {
const types = [];
if (typeof formatsString === "string" && formatsString) {
let formats = formatsString.split(",");
for (let format of formats) {
format = format.trim();
if (format === "QR_CODE")
The text was updated successfully, but these errors were encountered:
two-bridges
changed the title
App Crash if formatString is not string (iOS)
App Crash if formatString is Array (iOS)
Feb 9, 2021
If you pass an array to
format
attribute, the app running on a physical iOS device will crash.eg.
[formats]="['QR_CODE']"
Error:
formatsString.split is not a function
It was my error to try to send an array, but it was very painful to solve this issue in a production app.
I guess it could throw an ugly error but best if it did not to crash the whole app.
Possible Solution:
add
typeof formatsString
before trying to use formatsString, as shown below:/node_modules/nativescript-barcodescanner/barcodescanner.ios.js
The text was updated successfully, but these errors were encountered: