Skip to content

Commit

Permalink
fix(barcode-scanning): readBarcodesFromImage(...) throws a null exc…
Browse files Browse the repository at this point in the history
…eption on Android
  • Loading branch information
robingenz committed May 4, 2023
1 parent a77946f commit 3261833
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slow-snakes-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor-mlkit/barcode-scanning': patch
---

fix(android): `readBarcodesFromImage(...)` throws a null exception
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class BarcodeScannerHelper {
public static JSObject createBarcodeResultForBarcode(@NonNull Barcode barcode, @Nullable Point imageSize, @Nullable Point screenSize) {
Point[] cornerPoints = barcode.getCornerPoints();
JSArray cornerPointsResult = new JSArray();
if (cornerPoints != null || imageSize != null || screenSize != null) {
if (cornerPoints != null && imageSize != null && screenSize != null) {
Point[] normalizedCornerPoints = normalizeCornerPoints(cornerPoints, imageSize, screenSize);
for (int i = 0; i < normalizedCornerPoints.length; i++) {
JSArray cornerPointResult = new JSArray();
Expand Down

0 comments on commit 3261833

Please sign in to comment.