From 5b692067d8a04efdf5dfbf956c739d987161fe67 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 18 Apr 2021 20:26:23 +0200 Subject: [PATCH] patterns/fix: Accessing variables in global scope no longer crashes --- plugins/libimhex/source/lang/evaluator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/libimhex/source/lang/evaluator.cpp b/plugins/libimhex/source/lang/evaluator.cpp index 6dca40af9..36692dd1b 100644 --- a/plugins/libimhex/source/lang/evaluator.cpp +++ b/plugins/libimhex/source/lang/evaluator.cpp @@ -81,7 +81,8 @@ namespace hex::lang { PatternData *currPattern = nullptr; // Local member access - currPattern = this->findPattern(*this->m_currMembers.back(), path); + if (!this->m_currMembers.empty()) + currPattern = this->findPattern(*this->m_currMembers.back(), path); // If no local member was found, try globally if (currPattern == nullptr) {