diff --git a/Application/ApplicationManager.cs b/Application/ApplicationManager.cs index e16ec0469..7ecafa7be 100644 --- a/Application/ApplicationManager.cs +++ b/Application/ApplicationManager.cs @@ -196,7 +196,7 @@ namespace IW4MAdmin.Application } // we don't want to remove events that are correlated to command - if (ProcessingEvents.Values.Count(gameEvent => gameEvent.CorrelationId == newEvent.CorrelationId) == 1) + if (ProcessingEvents.Values.ToList()?.Count(gameEvent => gameEvent.CorrelationId == newEvent.CorrelationId) == 1) { ProcessingEvents.Remove(newEvent.Id, out _); } diff --git a/Application/RCon/RConConnection.cs b/Application/RCon/RConConnection.cs index 6995373db..8e0e8725c 100644 --- a/Application/RCon/RConConnection.cs +++ b/Application/RCon/RConConnection.cs @@ -435,6 +435,7 @@ namespace IW4MAdmin.Application.RCon if (bufferSpaceAvailable >= 0 ) { _log.LogWarning("Not enough buffer space to store incoming data {bytesNeeded} additional bytes required", bufferSpaceAvailable); + continue; } state.ReceiveEventArgs.SetBuffer(state.ReceiveBuffer, totalBytesTransferred, sock.Available);