From 57b445b576a077b4b79780b980f30911680cb897 Mon Sep 17 00:00:00 2001 From: cjohn001 <43253483+cjohn001@users.noreply.github.com> Date: Mon, 3 Feb 2025 20:26:58 +0100 Subject: [PATCH 1/2] fix bug when no bbox params er set --- packages/mlkit-core/index.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mlkit-core/index.ios.ts b/packages/mlkit-core/index.ios.ts index fba1075..133ded9 100644 --- a/packages/mlkit-core/index.ios.ts +++ b/packages/mlkit-core/index.ios.ts @@ -96,7 +96,7 @@ export class MLKitView extends MLKitViewBase { try { let data = JSON.parse(result); if (owner.detectionType === DetectionType.Object || owner.detectionType === DetectionType.CustomObject) { - if (owner._boundingBoxSettings.drawBBoxes || owner._boundingBoxSettings.drawEdgeMarks) { + if (owner._boundingBoxSettings?.drawBBoxes || owner._boundingBoxSettings?.drawEdgeMarks) { owner.drawBoundingBoxes(data); } } From 08f68765899109a35aea6ec9b22f0055b1462950 Mon Sep 17 00:00:00 2001 From: cjohn001 <43253483+cjohn001@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:56:49 +0100 Subject: [PATCH 2/2] fixes an issue where native view is already null when leaving the page --- packages/mlkit-core/index.ios.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mlkit-core/index.ios.ts b/packages/mlkit-core/index.ios.ts index 133ded9..698f6d9 100644 --- a/packages/mlkit-core/index.ios.ts +++ b/packages/mlkit-core/index.ios.ts @@ -540,10 +540,10 @@ export class MLKitView extends MLKitViewBase { } public onLayout(left: number, top: number, right: number, bottom: number) { - if (this._preview) { + if (this._preview && this.nativeView) { this._preview.frame = this.nativeView.bounds; } - if (this._overlayLayer) { + if (this._overlayLayer && this.nativeView) { this._overlayLayer.frame = this.nativeView.bounds; } }