From 71ed733874b1a30333ffd7ae996b130292b15e23 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 7 Dec 2021 22:08:00 +0100 Subject: [PATCH] fix: correctly handle null structs in Util.PrintOutObject --- Dalamud/Utility/Util.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index c44fbb25b..f545c1877 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -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(path)); + if (ptrObj == null) + { + ImGui.Text("null or invalid"); + } + else + { + PrintOutObject(ptrObj, (ulong)unboxed, new List(path)); + } } catch {