Try fix NPE
This commit is contained in:
parent
2399a1ba65
commit
e646141055
@ -20,7 +20,6 @@ namespace Network {
|
|||||||
|
|
||||||
public override void Initialize(string address, int port) {
|
public override void Initialize(string address, int port) {
|
||||||
GD.print("Start client.");
|
GD.print("Start client.");
|
||||||
GD.print("Starting to send stuff to " + address + ":" + port);
|
|
||||||
ServerConn = new Connection(address, port);
|
ServerConn = new Connection(address, port);
|
||||||
ServerConn.Name = "Server";
|
ServerConn.Name = "Server";
|
||||||
ConnectionList.AddConnection(ServerConn);
|
ConnectionList.AddConnection(ServerConn);
|
||||||
|
@ -34,9 +34,9 @@ namespace Network.Syncing {
|
|||||||
|
|
||||||
public void HandleRawPacket(PacketBuffer packetBuffer, Connection connection) {
|
public void HandleRawPacket(PacketBuffer packetBuffer, Connection connection) {
|
||||||
var Handler = GetHandlerFor(connection);
|
var Handler = GetHandlerFor(connection);
|
||||||
if (!Handler.HasValue) {
|
if (Handler.isEmpty) {
|
||||||
Handler = new ConnectionHandler(Peer, connection);
|
var Temp = new ConnectionHandler(Peer, connection);
|
||||||
HandlerList.Add(Handler);
|
HandlerList.Add(Temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user