diff --git a/Core/Chat/ChatReader.cs b/Core/Chat/ChatReader.cs index c98c455c..8a28d07c 100644 --- a/Core/Chat/ChatReader.cs +++ b/Core/Chat/ChatReader.cs @@ -67,6 +67,12 @@ public void Update(IAddonDataProvider reader) sb.Clear(); int firstSpaceIdx = text.AsSpan().IndexOf(' '); + if (firstSpaceIdx == -1) + { + logger.LogError($"Malformed payload: {text}"); + return; + } + string author = text.AsSpan(0, firstSpaceIdx).ToString(); string msg = text.AsSpan(firstSpaceIdx + 1).ToString();