From dfe66229824823f849c788e84f89d4b4b275d594 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Wed, 4 Sep 2024 23:15:53 +1000 Subject: [PATCH] net_slist: fix crash when there's no servers and net_slist_debug is enabled The crash was introduced in 5772ed20c13d65ac46e4ba60d153287a8a631ec5. Signed-off-by: bones_was_here --- netconn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netconn.c b/netconn.c index f88f678d..a8fb8417 100644 --- a/netconn.c +++ b/netconn.c @@ -2646,7 +2646,7 @@ void NetConn_QueryQueueFrame(void) // Nothing else to do until the next refresh cycle. serverlist_querystage = 0; pass = 0; - if (net_slist_debug.integer) + if (net_slist_debug.integer && serverlist_cachecount) Con_Printf("^4Finished checking server timeouts in %f\n", currentrealtime - serverlist_cache[serverlist_cachecount - 1].querytime); if (serverlist_cachecount >= SERVERLIST_TOTALSIZE) -- 2.39.2