Ensure AtkValue is even set before reading it as string

master
Liza 2024-07-14 23:23:30 +02:00
parent 93fac6efb0
commit acf4a98784
Signed by: liza
GPG Key ID: 7199F8D727D55F67
1 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,8 @@ public static class LAtkValue
{
public static unsafe string? ReadAtkString(this AtkValue atkValue)
{
if (atkValue.Type == ValueType.Undefined)
return null;
if (atkValue.String != null)
return MemoryHelper.ReadSeStringNullTerminated(new nint(atkValue.String)).ToString();
return null;