Skip to content

Commit

Permalink
Fix crash when currentSongIndex is null
Browse files Browse the repository at this point in the history
  • Loading branch information
07jasjeet committed Jan 22, 2025
1 parent 310c58e commit e188da3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ class BrainzPlayerViewModel @Inject constructor(

fun handleSongChangeFromPager(position:Int){
Log.d("PAGER", "handleSongChangeFromPager:$position , ${appPreferences.currentPlayable?.currentSongIndex} ")
if(position > appPreferences.currentPlayable?.currentSongIndex!!){
if(position > (appPreferences.currentPlayable?.currentSongIndex ?: 0)){
skipToNextSong()
}
else if(position < appPreferences.currentPlayable?.currentSongIndex!!){
else if(position < (appPreferences.currentPlayable?.currentSongIndex ?: 0)){
skipToPreviousSong()
}
}
Expand Down

0 comments on commit e188da3

Please sign in to comment.