check genres for null or whitespace

This commit is contained in:
Luke Pulverenti 2013-05-20 11:37:07 -04:00
parent e4d950e1a5
commit bba68471d7

View File

@ -186,7 +186,9 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
{
audio.Genres.Clear();
foreach (var genre in val.Split(new[] { '/', '|' }, StringSplitOptions.RemoveEmptyEntries))
foreach (var genre in val
.Split(new[] { '/', '|' }, StringSplitOptions.RemoveEmptyEntries)
.Where(i => !string.IsNullOrWhiteSpace(i)))
{
audio.AddGenre(genre);
}