fix: GetType safely

This commit is contained in:
Raymond 2021-12-05 17:19:17 -05:00
parent 287c7c8a78
commit cb78329f1d

View file

@ -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}");