add a null check to surfaceholder

This commit is contained in:
tibbi 2017-05-14 12:05:57 +02:00
parent dccca19844
commit 9e4d53684a

View file

@ -297,6 +297,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} }
private fun setVideoSize() { private fun setVideoSize() {
if (mSurfaceHolder == null)
mSurfaceHolder = mSurfaceView!!.holder
if (activity == null || !mSurfaceHolder!!.surface.isValid) if (activity == null || !mSurfaceHolder!!.surface.isValid)
return return