This can be solved by catching IndexOutOfBoundsException when trying to decide the next song by using get() on the song list.