From 493d66d991ef33196aabd79d77bf859cdeced6af Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 31 Dec 2024 21:30:05 +0100 Subject: [PATCH] fix: Crash when using hex editor when provider == nullptr --- plugins/ui/source/ui/hex_editor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/ui/source/ui/hex_editor.cpp b/plugins/ui/source/ui/hex_editor.cpp index 9e6a01b31..ce114d778 100644 --- a/plugins/ui/source/ui/hex_editor.cpp +++ b/plugins/ui/source/ui/hex_editor.cpp @@ -534,7 +534,10 @@ namespace hex::ui { ImGui::TableSetupScrollFreeze(0, 2); // Row address column - ImGui::TableSetupColumn("hex.ui.common.address"_lang, ImGuiTableColumnFlags_WidthFixed, CharacterSize.x * fmt::formatted_size("{:08X}: ", (m_scrollPosition + m_visibleRowCount) * m_bytesPerRow + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress())); + ImGui::TableSetupColumn("hex.ui.common.address"_lang, ImGuiTableColumnFlags_WidthFixed, + m_provider == nullptr ? 0 : + CharacterSize.x * fmt::formatted_size("{:08X}: ", (m_scrollPosition + m_visibleRowCount) * m_bytesPerRow + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress()) + ); ImGui::TableSetupColumn(""); // Byte columns