From 68e4619f0f8249f1a20e2925fd7ba3512ab686ed Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 21 Jul 2003 04:04:31 +0000 Subject: [PATCH] skip over NULL sockets in cl_sockets and sv_sockets lists git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3294 d7cf8633-e32d-0410-b094-e92efae38249 --- netconn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netconn.c b/netconn.c index 3c0f5322..ab269e98 100755 --- a/netconn.c +++ b/netconn.c @@ -338,7 +338,7 @@ lhnetsocket_t *NetConn_ChooseClientSocketForAddress(lhnetaddress_t *address) { int i, a = LHNETADDRESS_GetAddressType(address); for (i = 0;i < cl_numsockets;i++) - if (LHNETADDRESS_GetAddressType(LHNET_AddressFromSocket(cl_sockets[i])) == a) + if (cl_sockets[i] && LHNETADDRESS_GetAddressType(LHNET_AddressFromSocket(cl_sockets[i])) == a) return cl_sockets[i]; return NULL; } @@ -347,7 +347,7 @@ lhnetsocket_t *NetConn_ChooseServerSocketForAddress(lhnetaddress_t *address) { int i, a = LHNETADDRESS_GetAddressType(address); for (i = 0;i < sv_numsockets;i++) - if (LHNETADDRESS_GetAddressType(LHNET_AddressFromSocket(sv_sockets[i])) == a) + if (sv_sockets[i] && LHNETADDRESS_GetAddressType(LHNET_AddressFromSocket(sv_sockets[i])) == a) return sv_sockets[i]; return NULL; } -- 2.39.2