diff --git a/plugins/builtin/source/content/views/view_hex_editor.cpp b/plugins/builtin/source/content/views/view_hex_editor.cpp index 606974716..6fdaa8978 100644 --- a/plugins/builtin/source/content/views/view_hex_editor.cpp +++ b/plugins/builtin/source/content/views/view_hex_editor.cpp @@ -894,9 +894,11 @@ namespace hex::plugin::builtin { auto selection = this->m_hexEditor.getSelection(); - oldData.selectionStart = selection.getStartAddress(); - oldData.selectionEnd = selection.getEndAddress(); - oldData.scrollPosition = this->m_hexEditor.getScrollPosition(); + if (selection != Region::Invalid()) { + oldData.selectionStart = selection.getStartAddress(); + oldData.selectionEnd = selection.getEndAddress(); + oldData.scrollPosition = this->m_hexEditor.getScrollPosition(); + } } if (newProvider != nullptr) {