From 968cd6d601cca1c94f813a677567af21d86a1f5c Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Sun, 26 May 2019 13:46:43 -0400 Subject: [PATCH] Only call server request callback if not NULL. --- dll/steam_matchmaking_servers.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dll/steam_matchmaking_servers.cpp b/dll/steam_matchmaking_servers.cpp index ce3e789..72cdb01 100644 --- a/dll/steam_matchmaking_servers.cpp +++ b/dll/steam_matchmaking_servers.cpp @@ -424,16 +424,18 @@ void Steam_Matchmaking_Servers::RunCallbacks() if (r.cancelled || r.completed) continue; int i = 0; - for (auto &g : r.gameservers_filtered) { - PRINT_DEBUG("REQUESTS server responded cb %p\n", r.id); - r.callbacks->ServerResponded(r.id, i); - ++i; - } + if (r.callbacks) { + for (auto &g : r.gameservers_filtered) { + PRINT_DEBUG("REQUESTS server responded cb %p\n", r.id); + r.callbacks->ServerResponded(r.id, i); + ++i; + } - if (i) { - r.callbacks->RefreshComplete(r.id, eServerResponded); - } else { - r.callbacks->RefreshComplete(r.id, eNoServersListedOnMasterServer); + if (i) { + r.callbacks->RefreshComplete(r.id, eServerResponded); + } else { + r.callbacks->RefreshComplete(r.id, eNoServersListedOnMasterServer); + } } }