]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
net_slist: fix crash when there's no servers and net_slist_debug is enabled
authorbones_was_here <bones_was_here@xonotic.au>
Wed, 4 Sep 2024 13:15:53 +0000 (23:15 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 4 Sep 2024 13:16:50 +0000 (23:16 +1000)
The crash was introduced in 5772ed20c13d65ac46e4ba60d153287a8a631ec5.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
netconn.c

index f88f678dfd90298303adc93d9e936d6e0c0f2501..a8fb8417094c0d028852939926ee0104418ae78d 100644 (file)
--- 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)