diff --git a/ohos/src/main/ets/MobileScannerPlugin.ets b/ohos/src/main/ets/MobileScannerPlugin.ets index 7af6201eb7b781af39b90fb738762fce3fcfd579..d4100236bd220d1ab1516b64d5cf9564b39e8f89 100644 --- a/ohos/src/main/ets/MobileScannerPlugin.ets +++ b/ohos/src/main/ets/MobileScannerPlugin.ets @@ -249,10 +249,10 @@ export class MobileScannerPlugin implements FlutterPlugin, MethodCallHandler, Ab format: Barcode.convertScanType(item.scanType), type: BarcodeType.unknown, corners: [ - {x: this.scanCodeRect[i].left, y: this.scanCodeRect[i].top}, - {x: this.scanCodeRect[i].right, y: this.scanCodeRect[i].top}, - {x: this.scanCodeRect[i].left, y: this.scanCodeRect[i].bottom}, - {x: this.scanCodeRect[i].right, y: this.scanCodeRect[i].bottom}, + {x: this.scanCodeRect[i]?.left, y: this.scanCodeRect[i]?.top}, + {x: this.scanCodeRect[i]?.right, y: this.scanCodeRect[i]?.top}, + {x: this.scanCodeRect[i]?.left, y: this.scanCodeRect[i]?.bottom}, + {x: this.scanCodeRect[i]?.right, y: this.scanCodeRect[i]?.bottom}, ] } as Barcode; });