Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d165cd3

Browse files
committed
Fixes #920
1 parent efd7976 commit d165cd3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mlkit/mlkit-cameraview.android.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ export abstract class MLKitCameraView extends MLKitCameraViewBase {
115115
private runCamera(): void {
116116
// Note that surfaceview callbacks didn't seem to work, so using a good old timeout (https://github.com/firebase/quickstart-android/blob/0f4c86877fc5f771cac95797dffa8bd026dd9dc7/mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/CameraSourcePreview.java#L47)
117117
setTimeout(() => {
118+
if (!this.surfaceView) {
119+
return;
120+
}
118121
const surfaceHolder = this.surfaceView.getHolder();
119122
const cameraFacingRequested = android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK;
120123
const cameraInfo = new android.hardware.Camera.CameraInfo();

0 commit comments

Comments
 (0)