From ab7cbc0419da074f18bce3d2b94b00e9b647e508 Mon Sep 17 00:00:00 2001 From: Jenny White Date: Sun, 29 Apr 2018 12:33:13 +0300 Subject: [PATCH] fixed crash --- src/hooks/GetUserCmd.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hooks/GetUserCmd.cpp b/src/hooks/GetUserCmd.cpp index 688d17e6..6f3b7642 100644 --- a/src/hooks/GetUserCmd.cpp +++ b/src/hooks/GetUserCmd.cpp @@ -14,8 +14,11 @@ DEFINE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *this_, int sequence_number) int oldcmd; INetChannel *ch; + if (def == nullptr) + return def; + if (command_number_mod.find(def->command_number) != - command_number_mod.end() && def != nullptr) + command_number_mod.end()) { // logging::Info("Replacing command %i with %i", def->command_number, // command_number_mod[def->command_number]);