From 4ddb3db1ecd300742992d2ebe445e085287a9ecf Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 6 Jan 2024 16:06:52 -0500 Subject: [PATCH] Fix NavMap exception (#23636) --- Content.Server/Pinpointer/NavMapSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/Pinpointer/NavMapSystem.cs b/Content.Server/Pinpointer/NavMapSystem.cs index bdf2b6409a..567175abc5 100644 --- a/Content.Server/Pinpointer/NavMapSystem.cs +++ b/Content.Server/Pinpointer/NavMapSystem.cs @@ -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(); foreach (var grid in args.NewGrids) @@ -162,7 +165,7 @@ public sealed class NavMapSystem : SharedNavMapSystem RefreshGrid(newComp, gridQuery.GetComponent(grid)); } - RefreshGrid(Comp(args.Grid), gridQuery.GetComponent(args.Grid)); + RefreshGrid(comp, gridQuery.GetComponent(args.Grid)); } private void RefreshGrid(NavMapComponent component, MapGridComponent grid) -- 2.51.2