From 0011f41cdbb28963f23337becde17a0e59c3eadd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 11 Dec 2016 22:50:05 +0100 Subject: [PATCH] add a mediaplayer nullcheck --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 3 +++ 1 file changed, 3 insertions(+) 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 9aef76d50..f246c5cec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -289,6 +289,9 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C if (activity == null) return + if (mMediaPlayer == null) + initMediaPlayer() + val videoProportion = mMediaPlayer!!.videoWidth.toFloat() / mMediaPlayer!!.videoHeight.toFloat() val display = activity.windowManager.defaultDisplay val screenWidth: Int