From 75dd582dec7b45992bde84f9c09a1030cb83c011 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Sun, 22 Sep 2019 11:35:27 -0400 Subject: [PATCH] Fix crash when one of the lobby keys which was supposed to be an int was not an int. --- dll/steam_matchmaking.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dll/steam_matchmaking.h b/dll/steam_matchmaking.h index 4622cc2..7ca1df9 100644 --- a/dll/steam_matchmaking.h +++ b/dll/steam_matchmaking.h @@ -1152,16 +1152,21 @@ void RunCallbacks() } } } else { - int compare_to = stoi(value->second, 0, 0); - PRINT_DEBUG("Compare Values %i %i\n", compare_to, f.value_int); - if (f.eComparisonType == k_ELobbyComparisonEqual) { - if (compare_to == f.value_int) { - PRINT_DEBUG("Equal\n"); - //use = use; - } else { - PRINT_DEBUG("Not Equal\n"); - use = false; + try { + int compare_to = std::stoi(value->second, 0, 0); + PRINT_DEBUG("Compare Values %i %i\n", compare_to, f.value_int); + if (f.eComparisonType == k_ELobbyComparisonEqual) { + if (compare_to == f.value_int) { + PRINT_DEBUG("Equal\n"); + //use = use; + } else { + PRINT_DEBUG("Not Equal\n"); + use = false; + } } + } catch (...) { + //Same case as if the key is not in the lobby? + use = false; } //TODO: add more comparisons }