From d6c07eb41d22e25e6fd8b34be3b15e59c54af5ba Mon Sep 17 00:00:00 2001 From: raphaeIl Date: Mon, 1 Apr 2024 16:41:42 -0400 Subject: [PATCH] fix EndPoint null pointer --- BLHX.Server.Game/Connection.cs | 3 ++- BLHX.Server.PcapParser/App.config | 8 ++++---- BLHX.Server.PcapParser/BLHX.Server.PcapParser.csproj | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/BLHX.Server.Game/Connection.cs b/BLHX.Server.Game/Connection.cs index 35f6565..8e147b5 100644 --- a/BLHX.Server.Game/Connection.cs +++ b/BLHX.Server.Game/Connection.cs @@ -22,7 +22,8 @@ namespace BLHX.Server.Game readonly Task loopTask; ushort packetIdx = 0; private ushort NextPacketIdx => packetIdx; - public IPEndPoint EndPoint => (IPEndPoint?)tcpClient.Client.RemoteEndPoint ?? IPEndPoint.Parse("0.0.0.0:0"); + public IPEndPoint EndPoint => tcpClient?.Client?.RemoteEndPoint as IPEndPoint ?? IPEndPoint.Parse("0.0.0.0:0"); + public Connection(TcpClient tcpClient) { diff --git a/BLHX.Server.PcapParser/App.config b/BLHX.Server.PcapParser/App.config index 5f986e8..a58a46e 100644 --- a/BLHX.Server.PcapParser/App.config +++ b/BLHX.Server.PcapParser/App.config @@ -1,13 +1,13 @@ - + - + - - + + diff --git a/BLHX.Server.PcapParser/BLHX.Server.PcapParser.csproj b/BLHX.Server.PcapParser/BLHX.Server.PcapParser.csproj index 51cd527..6954ac4 100644 --- a/BLHX.Server.PcapParser/BLHX.Server.PcapParser.csproj +++ b/BLHX.Server.PcapParser/BLHX.Server.PcapParser.csproj @@ -8,7 +8,7 @@ Exe BLHX.Server.PcapParser BLHX.Server.PcapParser - v4.8.1 + v4.8 512 true true