- Add safety around extra chat GUID parsing

This commit is contained in:
Infi
2026-02-08 05:28:23 +01:00
parent 6744c6676c
commit 638ec1a211
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<Project Sdk="Dalamud.NET.Sdk/14.0.1"> <Project Sdk="Dalamud.NET.Sdk/14.0.1">
<PropertyGroup> <PropertyGroup>
<Version>1.34.1</Version> <Version>1.34.2</Version>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+11 -2
View File
@@ -158,8 +158,17 @@ internal partial class Message
{ {
// this does an encode and clone every time it's accessed, so cache // this does an encode and clone every time it's accessed, so cache
var data = raw.Data; var data = raw.Data;
if (data[1] == 0x27 && data[2] == 18 && data[3] == 0x20) try
return new Guid(data[4..^1]); {
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; return Guid.Empty;