From 18b714f9c382c930463440d0c3967da9ca19c613 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 28 May 2017 23:11:28 +0200 Subject: [PATCH] do not continue at setting up the video if theres an error --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 09875dfe7..3f894e8e8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -306,8 +306,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee return initMediaPlayer() - if (mMediaPlayer == null) + if (mMediaPlayer == null) { activity.toast(R.string.unknown_error_occurred) + return + } val videoProportion = mMediaPlayer!!.videoWidth.toFloat() / mMediaPlayer!!.videoHeight.toFloat() val display = activity.windowManager.defaultDisplay