Try fix NPE

This commit is contained in:
Sofia 2017-11-25 13:03:26 +02:00
parent 2399a1ba65
commit e646141055
2 changed files with 3 additions and 4 deletions

View File

@ -20,7 +20,6 @@ namespace Network {
public override void Initialize(string address, int port) {
GD.print("Start client.");
GD.print("Starting to send stuff to " + address + ":" + port);
ServerConn = new Connection(address, port);
ServerConn.Name = "Server";
ConnectionList.AddConnection(ServerConn);

View File

@ -34,9 +34,9 @@ namespace Network.Syncing {
public void HandleRawPacket(PacketBuffer packetBuffer, Connection connection) {
var Handler = GetHandlerFor(connection);
if (!Handler.HasValue) {
Handler = new ConnectionHandler(Peer, connection);
HandlerList.Add(Handler);
if (Handler.isEmpty) {
var Temp = new ConnectionHandler(Peer, connection);
HandlerList.Add(Temp);
}
}