]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixes wire exception spam (#14780)
authorFlipp Syder <76629141+vulppine@users.noreply.github.com>
Thu, 23 Mar 2023 02:53:29 +0000 (19:53 -0700)
committerGitHub <noreply@github.com>
Thu, 23 Mar 2023 02:53:29 +0000 (19:53 -0700)
Content.Server/Wires/WiresSystem.cs

index 6c6add46dbcd8cb6139936d1a95a2566df625c72..9d6a7c1966ce2f7e272076a7df8599b51fbf7d64 100644 (file)
@@ -340,10 +340,14 @@ public sealed class WiresSystem : EntitySystem
         {
             foreach (var (owner, wireAction) in _finishedWires)
             {
-                // sure
-                _activeWires[owner].RemoveAll(action => action.CancelToken == wireAction.CancelToken);
+                if (!_activeWires.TryGetValue(owner, out var activeWire))
+                {
+                    continue;
+                }
+
+                activeWire.RemoveAll(action => action.CancelToken == wireAction.CancelToken);
 
-                if (_activeWires[owner].Count == 0)
+                if (activeWire.Count == 0)
                 {
                     _activeWires.Remove(owner);
                 }