diff --git a/plugins/ui/include/ui/hex_editor.hpp b/plugins/ui/include/ui/hex_editor.hpp index ec969cddb..303c24cc9 100644 --- a/plugins/ui/include/ui/hex_editor.hpp +++ b/plugins/ui/include/ui/hex_editor.hpp @@ -262,7 +262,7 @@ namespace hex::ui { m_tooltipCallback = callback; } - [[nodiscard]] i64 getScrollPosition() const { + [[nodiscard]] i64 getScrollPosition() { return m_scrollPosition.get(); } diff --git a/plugins/ui/source/ui/hex_editor.cpp b/plugins/ui/source/ui/hex_editor.cpp index c76ad7687..7a5013194 100644 --- a/plugins/ui/source/ui/hex_editor.cpp +++ b/plugins/ui/source/ui/hex_editor.cpp @@ -311,7 +311,7 @@ namespace hex::ui { { const auto window = ImGui::GetCurrentWindowRead(); const auto axis = ImGuiAxis_Y; - ImS64 numRows = (m_provider->getSize() / m_bytesPerRow) + ((m_provider->getSize() % m_bytesPerRow) == 0 ? 0 : 1); + ImS64 numRows = m_provider == nullptr ? 0 : (m_provider->getSize() / m_bytesPerRow) + ((m_provider->getSize() % m_bytesPerRow) == 0 ? 0 : 1); const auto outerRect = window->Rect(); const auto innerRect = window->InnerRect;