Skip to content

Commit

Permalink
linvi#1099 Fixed issue that resulted in tracks ending with whitespace…
Browse files Browse the repository at this point in the history
…s to throw an Exception.
  • Loading branch information
linvi committed Apr 3, 2021
1 parent 78f3402 commit ace52b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Tweetinvi.Streams/Helpers/StreamTrackManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public void AddTrack(string track, Action<T> trackReceived = null)
if (_tracks.Count < MaxTracks)
{
var lowerTrack = track.ToLowerInvariant();
var trackSplit = lowerTrack.Split(' ');
var trackSplit = lowerTrack.Split(' ')
.Where(x => !x.IsNullOrEmpty())
.ToArray();

lock (this) // Not allowed to add multiple at the same time
{
Expand Down

0 comments on commit ace52b3

Please sign in to comment.