Fix a bug in the SplitMultibyteString I added a little bit ago. Splitting an empty string should result in a list of a single empty string, not an empty list

This commit is contained in:
nooperation
2025-06-29 01:10:10 -04:00
parent fd73a80e02
commit 7ca2bbdb7e

View File

@@ -1596,6 +1596,13 @@ namespace OpenMetaverse
{
throw new Exception("Split size must be at least 1 byte");
}
if (message.Length == 0)
{
return new List<string>()
{
string.Empty
};
}
var messageParts = new List<string>();
var messageBytes = System.Text.Encoding.UTF8.GetBytes(message);