fix: dont add empty strings to builder

This commit is contained in:
Mira 2022-11-29 09:06:58 +01:00
parent 1e4bcb07b0
commit 9cb981e86d
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36

View file

@ -171,7 +171,10 @@ public class Logger : ILogger
if (placeholderIndex == 0 && attemptedParsing)
placeholderIndex = leftOver.Length;
builder.Add(new StringPart { String = leftOver[..placeholderIndex] });
var str = leftOver[..placeholderIndex];
if (!string.IsNullOrEmpty(str))
builder.Add(new StringPart { String = str });
leftOver = leftOver[placeholderIndex..];
attemptedParsing = false;
}