Needed null check for replacing parent sector

This commit is contained in:
Nick 2023-08-08 00:32:34 -04:00
parent f765e07859
commit 894274cc17

View File

@ -258,7 +258,7 @@ namespace NewHorizons.Builder.Props
// Not doing else if here because idk if any of the classes below implement ISectorGroup // Not doing else if here because idk if any of the classes below implement ISectorGroup
if (component is Sector s && !existingSectors.Contains(s.GetParentSector())) if (component is Sector s && s.GetParentSector() != null && !existingSectors.Contains(s.GetParentSector()))
{ {
s.SetParentSector(sector); s.SetParentSector(sector);
} }