- Add safety around extra chat GUID parsing
This commit is contained in:
@@ -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
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user