Browse Source

Add null check for a peer in the selective broadcast

NX 7 years ago
parent
commit
41c505f534
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Native/enet.h

+ 2 - 2
Source/Native/enet.h

@@ -4218,7 +4218,7 @@ extern "C" {
         }
         }
 
 
         for (currentPeer = peers; currentPeer < &peers[length]; ++currentPeer) {
         for (currentPeer = peers; currentPeer < &peers[length]; ++currentPeer) {
-            if (currentPeer->state != ENET_PEER_STATE_CONNECTED) {
+            if (currentPeer != NULL && currentPeer->state != ENET_PEER_STATE_CONNECTED) {
                 continue;
                 continue;
             }
             }
 
 
@@ -5615,4 +5615,4 @@ extern "C" {
 }
 }
 #endif
 #endif
 #endif
 #endif
-#endif
+#endif