Skip to content

Commit 7fcabe5

Browse files
BeMacizedmvanbeusekom
authored andcommitted
[camera] Fix video recording exception on Android (flutter#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 b670a53 commit 7fcabe5

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
@@ -296,7 +296,9 @@ public void onCaptureFailed(
296296
@NonNull CameraCaptureSession session,
297297
@NonNull CaptureRequest request,
298298
@NonNull CaptureFailure failure) {
299-
assert (pictureCaptureRequest != null);
299+
if (pictureCaptureRequest == null || pictureCaptureRequest.isFinished()) {
300+
return;
301+
}
300302
String reason;
301303
switch (failure.getReason()) {
302304
case CaptureFailure.REASON_ERROR:

packages/camera/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: A Flutter plugin for getting information about and controlling the
66

77

88

9-
version: 0.6.3+1
9+
version: 0.6.3+2
1010
homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera
1111
dependencies:
1212
flutter:

0 commit comments

Comments
 (0)