From 5312d6f9fae1a05ad62fdb46ee5d29276949c12c Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 11 Oct 2022 20:18:16 +0200 Subject: [PATCH] fix: Data inspector still displaying entries with no selection --- .../builtin/source/content/views/view_data_inspector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/builtin/source/content/views/view_data_inspector.cpp b/plugins/builtin/source/content/views/view_data_inspector.cpp index 08c150081..3c25ed6bb 100644 --- a/plugins/builtin/source/content/views/view_data_inspector.cpp +++ b/plugins/builtin/source/content/views/view_data_inspector.cpp @@ -19,11 +19,11 @@ namespace hex::plugin::builtin { ViewDataInspector::ViewDataInspector() : View("hex.builtin.view.data_inspector.name") { EventManager::subscribe(this, [this](Region region) { - auto provider = ImHexApi::Provider::get(); - - if (!ImHexApi::Provider::isValid() || region.address == (size_t)-1) { + if (!ImHexApi::Provider::isValid() || region == Region::Invalid()) { this->m_validBytes = 0; } else { + auto provider = ImHexApi::Provider::get(); + this->m_validBytes = u64(provider->getActualSize() - region.address); this->m_startAddress = region.address; }