getSongByQueuePosition() shall return NULL if id is invalid
This commit is contained in:
1 parent
6ba1632057
commit
2f499f8927
1 file changed
+6
-1
@@ -580,7 +580,12 @@ public final class SongTimeline {
|
||||
* Returns 'Song' at given position in queue
|
||||
*/
|
||||
public Song getSongByQueuePosition(int id) {
|
||||
return mSongs.get(id);
|
||||
Song song = null;
|
||||
synchronized (this) {
|
||||
if (mSongs.size() > id)
|
||||
song = mSongs.get(id);
|
||||
}
|
||||
return song;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user