diff --git a/NewHorizons/Handlers/ShipLogHandler.cs b/NewHorizons/Handlers/ShipLogHandler.cs index 0d5faaf5..2ffb175f 100644 --- a/NewHorizons/Handlers/ShipLogHandler.cs +++ b/NewHorizons/Handlers/ShipLogHandler.cs @@ -26,9 +26,18 @@ namespace NewHorizons.Handlers _entryIDsToNHBody = new Dictionary(); _nhBodyToAstroIDs = new Dictionary(); - List gameObjects = SearchUtilities.GetAllChildren(SearchUtilities.Find(PAN_ROOT_PATH)); - _vanillaBodies = gameObjects.ConvertAll(g => g.name).ToArray(); - _vanillaBodyIDs = gameObjects.ConvertAll(g => g.GetComponent()?.GetID()).ToArray(); + GameObject panRoot = SearchUtilities.Find(PAN_ROOT_PATH); + if (panRoot != null) + { + List gameObjects = SearchUtilities.GetAllChildren(panRoot); + _vanillaBodies = gameObjects.ConvertAll(g => g.name).ToArray(); + _vanillaBodyIDs = gameObjects.ConvertAll(g => g.GetComponent()?.GetID()).ToArray(); + } + else + { + _vanillaBodies = new string[0]; + _vanillaBodyIDs = new string[0]; + } } public static void CheckForModdedFacts(ShipLogManager manager)