Skip to content

Commit

Permalink
chore(processor): add guard against non-array values from frame-proce…
Browse files Browse the repository at this point in the history
…ssor
  • Loading branch information
mgcrea committed Oct 13, 2023
1 parent e8ac84e commit a3028c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export const scanCodes = (
frame,
options,
) as unknown as (AndroidBarcode | iOSBarcode)[];
if (!Array.isArray(nativeCodes)) {
console.warn("Native frame processor failed to return a proper array!");
return [];
}
return nativeCodes.map((nativeBarcode) =>
normalizeNativeBarcode(nativeBarcode, frame),
);
Expand Down

0 comments on commit a3028c1

Please sign in to comment.