From b54f46de30f93ec5d7dcb50300b52da7b1650dbb Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 17 May 2024 22:43:35 +0200 Subject: [PATCH] fix: Crash when setting selection in a hex editor instance without provider --- plugins/ui/include/ui/hex_editor.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ui/include/ui/hex_editor.hpp b/plugins/ui/include/ui/hex_editor.hpp index 15688d80e..67b1bce45 100644 --- a/plugins/ui/include/ui/hex_editor.hpp +++ b/plugins/ui/include/ui/hex_editor.hpp @@ -114,7 +114,7 @@ namespace hex::ui { } void setSelection(const Region ®ion) { this->setSelection(region.getStartAddress(), region.getEndAddress()); } void setSelection(u128 start, u128 end) { - if (!ImHexApi::Provider::isValid()) + if (!ImHexApi::Provider::isValid() || m_provider == nullptr) return; if (start > m_provider->getBaseAddress() + m_provider->getActualSize())