diff options
author | Federico Guerinoni <guerinoni.federico@gmail.com> | 2022-01-16 10:58:09 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-14 11:42:04 +0100 |
commit | 932ce93fd77d9e61b5ca85967960a50a948eae4e (patch) | |
tree | 93206d6c591ef75956e5e7dd82331ad1796c9e1b /Userland/Applications | |
parent | 53ff271c6fffc64800e1f1ba5cf5dc8938fd0a8c (diff) | |
download | serenity-932ce93fd77d9e61b5ca85967960a50a948eae4e.zip |
HexEditor: Fix crash of copy action when selection is empty
Closes: #11925
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/HexEditor/HexEditor.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/HexEditor/HexEditor.h b/Userland/Applications/HexEditor/HexEditor.h index 2ad80a8a4c..07834dee76 100644 --- a/Userland/Applications/HexEditor/HexEditor.h +++ b/Userland/Applications/HexEditor/HexEditor.h @@ -41,7 +41,7 @@ public: bool save(); void select_all(); - bool has_selection() const { return !((m_selection_end < m_selection_start) || m_document->size()); } + bool has_selection() const { return m_selection_start < m_selection_end && m_document->size() > 0; } size_t selection_size(); size_t selection_start_offset() const { return m_selection_start; } bool copy_selected_text_to_clipboard(); |