From: havoc Date: Mon, 21 Jul 2003 04:04:31 +0000 (+0000) Subject: skip over NULL sockets in cl_sockets and sv_sockets lists X-Git-Tag: xonotic-v0.1.0preview~6514 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=68e4619f0f8249f1a20e2925fd7ba3512ab686ed;p=xonotic%2Fdarkplaces.git 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 --- 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; }