]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix NavMap exception (#23636)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sat, 6 Jan 2024 21:06:52 +0000 (16:06 -0500)
committerGitHub <noreply@github.com>
Sat, 6 Jan 2024 21:06:52 +0000 (16:06 -0500)
Content.Server/Pinpointer/NavMapSystem.cs

index bdf2b6409a292e1d12f21f41cb33583a7ee98f32..567175abc516f2cb4febdc61c3eadd86b0282528 100644 (file)
@@ -154,6 +154,9 @@ public sealed class NavMapSystem : SharedNavMapSystem
 
     private void OnNavMapSplit(ref GridSplitEvent args)
     {
+        if (!TryComp(args.Grid, out NavMapComponent? comp))
+            return;
+
         var gridQuery = GetEntityQuery<MapGridComponent>();
 
         foreach (var grid in args.NewGrids)
@@ -162,7 +165,7 @@ public sealed class NavMapSystem : SharedNavMapSystem
             RefreshGrid(newComp, gridQuery.GetComponent(grid));
         }
 
-        RefreshGrid(Comp<NavMapComponent>(args.Grid), gridQuery.GetComponent(args.Grid));
+        RefreshGrid(comp, gridQuery.GetComponent(args.Grid));
     }
 
     private void RefreshGrid(NavMapComponent component, MapGridComponent grid)