Fix all of the nullable issues
This commit is contained in:
1 parent
9d97ad0975
commit
30feb15821
13 files changed
+58
-53
No files matched your search
@@ -21,9 +21,9 @@ namespace Mistox.Client {
|
||||
UdpReceiveResult udpPacket = await _parent.ClientSocket.ReceiveAsync();
|
||||
|
||||
// Try find the user
|
||||
mUDPClient client = null;
|
||||
bool clientExists = _parent.clientConnections.TryGetValue(udpPacket.RemoteEndPoint, out client);
|
||||
if (clientExists) {
|
||||
mUDPClient? client = null;
|
||||
_parent.clientConnections.TryGetValue(udpPacket.RemoteEndPoint, out client);
|
||||
if (client != null) {
|
||||
|
||||
// Create the data readers
|
||||
ReadOnlyMemory<byte> dataMemory = udpPacket.Buffer.AsMemory();
|
||||
@@ -39,10 +39,12 @@ namespace Mistox.Client {
|
||||
ReadOnlyMemory<byte> data = dataMemory.Slice(DataPacket.HeaderLength, Header.DataLength);
|
||||
|
||||
// Extract the object
|
||||
dynamic buildObj = DataPacket.Deserialize( Header, data );
|
||||
object? buildObj = DataPacket.Deserialize( Header, data );
|
||||
if (buildObj != null) {
|
||||
|
||||
// Return the object
|
||||
_parent.InvokeOnReceived( buildObj, client );
|
||||
// Return the object
|
||||
_parent.InvokeOnReceived( buildObj, client );
|
||||
}
|
||||
|
||||
}
|
||||
} catch( Exception e ) {
|
||||
|
||||
Reference in new issue
Block a user