Skip to content

Commit

Permalink
net_slist: fix crash when there's no servers and net_slist_debug is e…
Browse files Browse the repository at this point in the history
…nabled

The crash was introduced in 5772ed2.

Signed-off-by: bones_was_here <[email protected]>
  • Loading branch information
bones-was-here committed Sep 4, 2024
1 parent d6b2b14 commit dfe6622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netconn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dfe6622

Please sign in to comment.