From 4e9028ac8a130258de282204df91902f2ddf63da Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 1 Jun 2023 00:00:47 -0700 Subject: [PATCH] CVars: Fix bad matching logic causing crashes --- shared/sdk/ConsoleManager.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/sdk/ConsoleManager.hpp b/shared/sdk/ConsoleManager.hpp index b5bfd07b..5c8b43bb 100644 --- a/shared/sdk/ConsoleManager.hpp +++ b/shared/sdk/ConsoleManager.hpp @@ -66,7 +66,7 @@ class FConsoleManager : public IConsoleManager { std::vector results{}; for (auto& element : m_console_objects) { - if (element.key != nullptr & element.value != nullptr) { + if (element.key != nullptr && element.value != nullptr) try { // case insensitive compare std::wstring lower_key = element.key; std::transform(lower_key.begin(), lower_key.end(), lower_key.begin(), ::towlower); @@ -74,6 +74,8 @@ class FConsoleManager : public IConsoleManager { if (lower_key.find(lower_name) != std::wstring::npos) { results.push_back(element); } + } catch(...) { + continue; } }