Trim empty entries in string split calls

This commit is contained in:
Slendy 2023-02-11 21:12:10 -06:00
commit e93aea1977
No known key found for this signature in database
GPG key ID: 7288D68361B91428
3 changed files with 4 additions and 5 deletions

View file

@ -57,9 +57,7 @@
}
else
{
authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? Array.Empty<string>();
// Split() returns an array with an empty character for some reason
if (authorLabels.Length == 1) authorLabels = Array.Empty<string>();
authorLabels = Model.Slot?.AuthorLabels.Split(",", StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>();
}
if (authorLabels.Length == 0)
{