]> Dogcows Code - chaz/carfire/commitdiff
null pointer dereference fix
authorCharles <Charles@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Wed, 31 Mar 2010 00:46:21 +0000 (00:46 +0000)
committerCharles <Charles@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Wed, 31 Mar 2010 00:46:21 +0000 (00:46 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@43 92bb83a3-7c8f-8a45-bc97-515c4e399668

Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs

index 45c5d0a498fdd5a1ce9de1445b85cdbd309a6187..ae0396bb1901fb85ff767b1e7e6752202c790e0c 100644 (file)
@@ -1,5 +1,5 @@
 \r
-#undef DEBUG\r
+//#define DEBUG\r
 \r
 using System;\r
 using System.Collections.Generic;\r
@@ -641,8 +641,6 @@ namespace CS_3505_Project_06
                 NetworkGamer sender;\r
 \r
                 localGamer.ReceiveData(mPacketReader, out sender);\r
-                if (sender == null || sender.IsDisposed) continue;\r
-                GamerInfo senderInfo = mGamers[sender.Id];\r
 \r
                 PacketType packetId = (PacketType)mPacketReader.ReadByte();\r
                 switch (packetId)\r
@@ -658,6 +656,8 @@ namespace CS_3505_Project_06
 \r
                     case PacketType.Event:\r
 \r
+                        GamerInfo senderInfo = mGamers[sender.Id];\r
+\r
                         int stallCount = mPacketReader.ReadInt16();\r
                         int averageOwd = mPacketReader.ReadInt16();\r
                         int frameNumber = mPacketReader.ReadInt32();\r
@@ -705,6 +705,8 @@ namespace CS_3505_Project_06
 \r
                     case PacketType.Stall:\r
 \r
+                        GamerInfo senderInfo2 = mGamers[sender.Id];\r
+\r
                         byte numStalledPeers = mPacketReader.ReadByte();\r
                         byte[] stalledPeers = mPacketReader.ReadBytes(numStalledPeers);\r
 \r
This page took 0.024735 seconds and 4 git commands to generate.