Skip to content

Commit 39c0cd8

Browse files
authored
fix: check if bbox params are set (#72)
1 parent 1127938 commit 39c0cd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/mlkit-core/index.ios.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class MLKitView extends MLKitViewBase {
9696
try {
9797
let data = JSON.parse(result);
9898
if (owner.detectionType === DetectionType.Object || owner.detectionType === DetectionType.CustomObject) {
99-
if (owner._boundingBoxSettings.drawBBoxes || owner._boundingBoxSettings.drawEdgeMarks) {
99+
if (owner._boundingBoxSettings?.drawBBoxes || owner._boundingBoxSettings?.drawEdgeMarks) {
100100
owner.drawBoundingBoxes(data);
101101
}
102102
}
@@ -540,10 +540,10 @@ export class MLKitView extends MLKitViewBase {
540540
}
541541

542542
public onLayout(left: number, top: number, right: number, bottom: number) {
543-
if (this._preview) {
543+
if (this._preview && this.nativeView) {
544544
this._preview.frame = this.nativeView.bounds;
545545
}
546-
if (this._overlayLayer) {
546+
if (this._overlayLayer && this.nativeView) {
547547
this._overlayLayer.frame = this.nativeView.bounds;
548548
}
549549
}

0 commit comments

Comments
 (0)