From 638ec1a21196d9fb3d49f5cf351e8f72818769a9 Mon Sep 17 00:00:00 2001 From: Infi Date: Sun, 8 Feb 2026 05:28:23 +0100 Subject: [PATCH] - Add safety around extra chat GUID parsing --- ChatTwo/ChatTwo.csproj | 2 +- ChatTwo/Message.cs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index 33520b9..5df989a 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,6 +1,6 @@ - 1.34.1 + 1.34.2 enable enable true diff --git a/ChatTwo/Message.cs b/ChatTwo/Message.cs index 54ada50..f59e909 100755 --- a/ChatTwo/Message.cs +++ b/ChatTwo/Message.cs @@ -158,8 +158,17 @@ internal partial class Message { // this does an encode and clone every time it's accessed, so cache var data = raw.Data; - if (data[1] == 0x27 && data[2] == 18 && data[3] == 0x20) - return new Guid(data[4..^1]); + try + { + if (data[1] == 0x27 && data[2] == 18 && data[3] == 0x20) + return new Guid(data[4..^1]); + } + catch (ArgumentException ex) + { + Plugin.Log.Error(ex, "Failed to parse extra chat channel GUID"); + Plugin.Log.Error($"Byte Array: ${string.Join(", ", data[4..^1])}"); + return Guid.Empty; + } } return Guid.Empty;