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 e3e7c5a2d..27342d095 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -431,7 +431,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) } - private fun videoEnded() = mExoPlayer!!.currentPosition >= mExoPlayer!!.duration + private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0 private fun setProgress(seconds: Int) { mExoPlayer!!.seekTo(seconds * 1000L)