From c6224ad332274aea3ae3678acfe75d74c8c91c7e Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 27 Jul 2023 16:21:18 +0530 Subject: [PATCH] Avoid NullPointerException --- .../com/simplemobiletools/musicplayer/services/MusicService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt index 59994c4b..83e280ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt @@ -355,7 +355,7 @@ class MusicService : Service(), MultiPlayer.PlaybackCallbacks { mCurrTrackCover = getAlbumImage().first trackChanged() - val secs = getPosition()!! / 1000 + val secs = (getPosition() ?: 0) / 1000 broadcastTrackProgress(secs) } trackStateChanged()