From b4c2cf2ea434e0693fbb8f18836a5d621c8aaa72 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 31 May 2021 13:11:01 -0700 Subject: [PATCH] Prevent potential nullptr deeref --- Runtime/ImGuiConsole.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Runtime/ImGuiConsole.cpp b/Runtime/ImGuiConsole.cpp index ba6fb0800..309b6c168 100644 --- a/Runtime/ImGuiConsole.cpp +++ b/Runtime/ImGuiConsole.cpp @@ -347,6 +347,9 @@ void ImGuiConsole::ShowInspectWindow(bool* isOpen) { bool ImGuiConsole::ShowEntityInfoWindow(TUniqueId uid) { bool open = true; ImGuiEntityEntry& entry = ImGuiConsole::entities[uid.Value()]; + if (entry.ent == nullptr) { + return false; + } auto name = fmt::format(FMT_STRING("{}##0x{:04X}"), !entry.name.empty() ? entry.name : entry.type, uid.Value()); if (ImGui::Begin(name.c_str(), &open, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::PushID(uid.Value());