Fix json array string writer in JsonDelimitedArrayConverter (#12949)

This commit is contained in:
gnattu 2024-11-04 23:04:04 +08:00 committed by GitHub
parent 954950dc14
commit 3089e9e40a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,24 +71,11 @@ namespace Jellyfin.Extensions.Json.Converters
writer.WriteStartArray();
if (value.Length > 0)
{
var toWrite = value.Length - 1;
foreach (var it in value)
{
var wrote = false;
if (it is not null)
{
writer.WriteStringValue(it.ToString());
wrote = true;
}
if (toWrite > 0)
{
if (wrote)
{
writer.WriteStringValue(Delimiter.ToString());
}
toWrite--;
}
}
}