diff --git a/src/NadekoBot/Services/Music/MusicPlayer.cs b/src/NadekoBot/Services/Music/MusicPlayer.cs index 5c698fb3..a6b0cbfb 100644 --- a/src/NadekoBot/Services/Music/MusicPlayer.cs +++ b/src/NadekoBot/Services/Music/MusicPlayer.cs @@ -480,9 +480,10 @@ namespace NadekoBot.Services.Music lock (locker) { var cur = Queue.Current; + var toReturn = Queue.RemoveAt(index); if (cur.Index == index) Next(); - return Queue.RemoveAt(index); + return toReturn; } } diff --git a/src/NadekoBot/Services/Music/MusicQueue.cs b/src/NadekoBot/Services/Music/MusicQueue.cs index 50135b72..681f3936 100644 --- a/src/NadekoBot/Services/Music/MusicQueue.cs +++ b/src/NadekoBot/Services/Music/MusicQueue.cs @@ -95,11 +95,12 @@ namespace NadekoBot.Services.Music if (index < 0 || index >= Songs.Count) throw new ArgumentOutOfRangeException(nameof(index)); - var current = Songs.First; + var current = Songs.First.Value; for (int i = 0; i < Songs.Count; i++) { if (i == index) { + current = Songs.ElementAt(index); Songs.Remove(current); if (CurrentIndex != 0) { @@ -111,7 +112,7 @@ namespace NadekoBot.Services.Music break; } } - return current.Value; + return current; } }