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

Commit 7eff062

Browse files
[camera] Fix video recording exception on Android (#3375)
* Fixed video recording * Update changelog and pubspec version * Update packages/camera/camera/CHANGELOG.md Co-authored-by: Maurits van Beusekom <[email protected]> Co-authored-by: Maurits van Beusekom <[email protected]>
1 parent a9513d5 commit 7eff062

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

packages/camera/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.3+2
2+
3+
* Fixes crash on Android which occurs after video recording has stopped just before taking a picture.
4+
15
## 0.6.3+1
26

37
* Fixes flash & torch modes not working on some Android devices.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ public void onCaptureFailed(
276276
@NonNull CameraCaptureSession session,
277277
@NonNull CaptureRequest request,
278278
@NonNull CaptureFailure failure) {
279-
assert (pictureCaptureRequest != null);
279+
if (pictureCaptureRequest == null || pictureCaptureRequest.isFinished()) {
280+
return;
281+
}
280282
String reason;
281283
switch (failure.getReason()) {
282284
case CaptureFailure.REASON_ERROR:

packages/camera/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
44
and streaming image buffers to dart.
5-
version: 0.6.3+1
5+
version: 0.6.3+2
66
homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera
77

88
dependencies:

0 commit comments

Comments
 (0)