adding a null check at the MediaSideScroll

This commit is contained in:
tibbi 2019-08-11 15:56:38 +02:00
parent 4595f6549a
commit 6033d6a812

View file

@ -121,7 +121,7 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co
return true
}
private fun getCurrentVolume() = activity!!.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
private fun getCurrentVolume() = activity?.audioManager?.getStreamVolume(AudioManager.STREAM_MUSIC) ?: 0
private fun getCurrentBrightness(): Int {
return try {