From 08a12dd2b013b2e3c78ee2e252b0c06c9d85e6e5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 28 Sep 2022 21:39:46 +0200 Subject: [PATCH] fix: Crash when dragging the mouse onto the hex view --- plugins/builtin/source/content/views/view_hex_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/builtin/source/content/views/view_hex_editor.cpp b/plugins/builtin/source/content/views/view_hex_editor.cpp index 2c40bff60..b11eedcef 100644 --- a/plugins/builtin/source/content/views/view_hex_editor.cpp +++ b/plugins/builtin/source/content/views/view_hex_editor.cpp @@ -1160,12 +1160,12 @@ namespace hex::plugin::builtin { auto &selectionStart = ProviderExtraData::getCurrent().editor.selectionStart; if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) { - this->setSelection(*selectionStart, endAddress); + this->setSelection(selectionStart.value_or(address), endAddress); this->scrollToSelection(); } else if (ImGui::IsMouseDown(ImGuiMouseButton_Left)) { if (ImGui::GetIO().KeyShift) - this->setSelection(*selectionStart, endAddress); + this->setSelection(selectionStart.value_or(address), endAddress); else this->setSelection(address, endAddress);