Skip to content

Commit

Permalink
CVars: Fix bad matching logic causing crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jun 1, 2023
1 parent 7842daf commit 4e9028a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shared/sdk/ConsoleManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ class FConsoleManager : public IConsoleManager {
std::vector<ConsoleObjectElement> 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);

if (lower_key.find(lower_name) != std::wstring::npos) {
results.push_back(element);
}
} catch(...) {
continue;
}
}

Expand Down

0 comments on commit 4e9028a

Please sign in to comment.