From cb78329f1d4cdecb50690914d1a24a31d3ba8e73 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 5 Dec 2021 17:19:17 -0500 Subject: [PATCH] fix: GetType safely --- Dalamud/Utility/Util.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index e903badd9..f69a75f60 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -175,7 +175,8 @@ namespace Dalamud.Utility foreach (var propertyInfo in type.GetProperties()) { var value = propertyInfo.GetValue(obj); - if (value.GetType() == typeof(IntPtr)) + var valueType = value?.GetType(); + if (valueType == typeof(IntPtr)) ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: 0x{value:X}"); else ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: {value}");