]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
skip over NULL sockets in cl_sockets and sv_sockets lists
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 21 Jul 2003 04:04:31 +0000 (04:04 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 21 Jul 2003 04:04:31 +0000 (04:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3294 d7cf8633-e32d-0410-b094-e92efae38249

netconn.c

index 3c0f53220662d7b18c8098271f0b203b5cca2e30..ab269e9876944f003758e5418d5ccef21da03dd2 100755 (executable)
--- 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;
 }