Skip to content

Commit

Permalink
fix: Crash when using hex editor when provider == nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Dec 31, 2024
1 parent 268b495 commit 493d66d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/ui/source/ui/hex_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 493d66d

Please sign in to comment.