fixed out of bound issue with music list

This commit is contained in:
Harrison Deng 2018-01-15 16:58:23 -06:00
parent 4473bd6518
commit 9880c0ed7a

View File

@ -126,9 +126,9 @@ public class MusicListController extends Observable implements OnCompletionListe
mm.dispose(); mm.dispose();
} }
if (currentPlaybackID < 0) { if (currentPlaybackID < 0) {
currentPlaybackID = musicList.getTotal(); currentPlaybackID = musicList.getTotal()-1;
} }
if (currentPlaybackID > musicList.getTotal()) { if (currentPlaybackID >= musicList.getTotal()) {
currentPlaybackID = 0; currentPlaybackID = 0;
} }
this.mm = musicList.getMusicInfoFromIndex(currentPlaybackID); this.mm = musicList.getMusicInfoFromIndex(currentPlaybackID);