fix: correctly handle null structs in Util.PrintOutObject

This commit is contained in:
goat 2021-12-07 22:08:00 +01:00
parent ca15a9c035
commit 71ed733874
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -186,7 +186,14 @@ namespace Dalamud.Utility
var eType = type.GetElementType();
var ptrObj = SafeMemory.PtrToStructure(new IntPtr(unboxed), eType);
ImGui.SameLine();
PrintOutObject(ptrObj, (ulong)unboxed, new List<string>(path));
if (ptrObj == null)
{
ImGui.Text("null or invalid");
}
else
{
PrintOutObject(ptrObj, (ulong)unboxed, new List<string>(path));
}
}
catch
{