Skip to content

Commit 8536a29

Browse files
authored
fix(netpacket): Fix misplaced null test in NetPacket::addCommand() (TheSuperHackers#2272)
1 parent e233be6 commit 8536a29

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Core/GameEngine/Source/GameNetwork/NetPacket.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,12 @@ void NetPacket::setAddress(Int addr, Int port) {
10151015
Bool NetPacket::addCommand(NetCommandRef *msg) {
10161016
// This is where the fun begins...
10171017

1018-
NetCommandMsg *cmdMsg = msg->getCommand();
1019-
10201018
if (msg == nullptr) {
10211019
return TRUE; // There was nothing to add, so it was successful.
10221020
}
10231021

1022+
NetCommandMsg *cmdMsg = msg->getCommand();
1023+
10241024
switch(cmdMsg->getNetCommandType())
10251025
{
10261026
case NETCOMMANDTYPE_GAMECOMMAND:

0 commit comments

Comments
 (0)