playback: dont apply state mirror w/no song

Otherwise, the StateHolder will crash.
This commit is contained in:
Alexander Capehart
2024-01-28 21:38:45 -07:00
parent fbd8d4b361
commit ced462e718
@@ -418,7 +418,7 @@ class PlaybackStateManagerImpl @Inject constructor() : PlaybackStateManager {
}
this.stateHolder = stateHolder
if (isInitialized) {
if (isInitialized && stateMirror.index > -1) {
stateHolder.applySavedState(stateMirror.parent, stateMirror.rawQueue, null)
stateHolder.seekTo(stateMirror.progression.calculateElapsedPositionMs())
stateHolder.playing(false)
@@ -753,7 +753,7 @@ class PlaybackStateManagerImpl @Inject constructor() : PlaybackStateManager {
}
var index = savedState.index
while (pointingAtSong() && index > -1) {
while (!pointingAtSong() && index > -1) {
index--
}