From 6033d6a8124573457e1aca591cff98e400de5a0f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 11 Aug 2019 15:56:38 +0200 Subject: [PATCH] adding a null check at the MediaSideScroll --- .../com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt index 52ebde06e..50a338666 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt @@ -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 {