add an additional null check at surfaceholder of video fragment

This commit is contained in:
tibbi 2017-05-31 23:20:34 +02:00
parent f4ddc12911
commit d2713635d5

View file

@ -302,7 +302,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
if (mSurfaceHolder == null)
mSurfaceHolder = mSurfaceView!!.holder
if (activity == null || !mSurfaceHolder!!.surface.isValid)
if (activity == null || mSurfaceHolder == null || !mSurfaceHolder!!.surface.isValid)
return
initMediaPlayer()