From 95e75b4e745c25d29a701fc5f96adc5acd444125 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 23 Jan 2018 16:37:19 +0100 Subject: [PATCH] show an error if no profile has been retrieved at video recording --- .../kotlin/com/simplemobiletools/camera/views/Preview.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt index f06c19ee..e4f2a8be 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt @@ -636,6 +636,11 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan CamcorderProfile.get(CamcorderProfile.QUALITY_LOW) } + if (profile == null) { + mActivity?.toast(R.string.unknown_error_occurred) + return false + } + profile.apply { videoFrameWidth = resolution.width videoFrameHeight = resolution.height