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

Commit 9df6eda

Browse files
authored
Update Camera.java
1 parent a346783 commit 9df6eda

File tree

1 file changed

+4
-1
lines changed
  • packages/camera/android/src/main/java/io/flutter/plugins/camera

1 file changed

+4
-1
lines changed

packages/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,10 @@ public void resumeVideoRecording(@NonNull final Result result) {
410410
}
411411

412412
public void startPreview() throws CameraAccessException {
413-
createCaptureSession(CameraDevice.TEMPLATE_PREVIEW, pictureImageReader.getSurface());
413+
// createCaptureSession(CameraDevice.TEMPLATE_PREVIEW, pictureImageReader.getSurface());
414+
if (pictureImageReader != null) {
415+
createCaptureSession(CameraDevice.TEMPLATE_PREVIEW, pictureImageReader.getSurface());
416+
}
414417
}
415418

416419
public void startPreviewWithImageStream(EventChannel imageStreamChannel)

0 commit comments

Comments
 (0)