From 9e4d53684acf7e234a5b63fe6fa47c74de2a7410 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 14 May 2017 12:05:57 +0200 Subject: [PATCH] add a null check to surfaceholder --- .../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 ed0520ed7..de8af3253 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -297,6 +297,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } private fun setVideoSize() { + if (mSurfaceHolder == null) + mSurfaceHolder = mSurfaceView!!.holder + if (activity == null || !mSurfaceHolder!!.surface.isValid) return