diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 225601054fb9..461b2d927eda 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.3+2 + +* Fixes crash on Android which occurs after video recording has stopped just before taking a picture. + ## 0.6.3+1 * Fixes flash & torch modes not working on some Android devices. diff --git a/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java b/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java index 0116ce3c0e4d..3c28d6655e48 100644 --- a/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java +++ b/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java @@ -276,7 +276,9 @@ public void onCaptureFailed( @NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { - assert (pictureCaptureRequest != null); + if (pictureCaptureRequest == null || pictureCaptureRequest.isFinished()) { + return; + } String reason; switch (failure.getReason()) { case CaptureFailure.REASON_ERROR: diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 43a5fca3da21..1f5d06eecbe3 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -2,7 +2,7 @@ name: camera description: A Flutter plugin for getting information about and controlling the camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video, and streaming image buffers to dart. -version: 0.6.3+1 +version: 0.6.3+2 homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera dependencies: