From 44895ae3654c5cb00185ec8650d1af7d1526211b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 18:11:20 +0100 Subject: [PATCH] add a null check at video fastforwarding --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 ++++ 1 file changed, 4 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 5cf2dc092..1f7ee9084 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -471,6 +471,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } private fun skip(forward: Boolean) { + if (mMediaPlayer == null) { + return + } + val curr = mMediaPlayer!!.currentPosition val twoPercents = mMediaPlayer!!.duration / 50 val newProgress = if (forward) curr + twoPercents else curr - twoPercents