Links not getting updated when loading graphs from file at runtime

I have some button in the level that changes the layout of the level. I precomputed the navmeshes for both states (on/off) and saved them to different files. There are also links (NodeLink2) that get toggled when the button state changes. If I use only; , AstarPath.OnGraphsUpdated is not triggered and the AI doesn’t consider the links at all (as if they’re not there). I tried to forcefully update all the graph after deserializing the file but am getting some exceptions regarding PointNode. How should I tackle this?

protected void OnEnable()
    if (loadOnEnable)

public void Load()
    if (!navmeshData)
        return;; Bounds(


NullReferenceException: Object reference not set to an instance of an object
Pathfinding.PointNode.AddConnection (Pathfinding.GraphNode node, System.UInt32 cost) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:142)
Pathfinding.NodeLink2.Apply (System.Boolean forceNewCheck) (at Assets/AstarPathfindingProject/Core/Misc/NodeLink2.cs:196)
Pathfinding.NodeLink2.OnGraphsPostUpdate () (at Assets/AstarPathfindingProject/Core/Misc/NodeLink2.cs:131)
Pathfinding.GraphModifier.TriggerEvent (Pathfinding.GraphModifier+EventType type) (at Assets/AstarPathfindingProject/Core/Misc/GraphModifier.cs:80)
Pathfinding.GraphUpdateProcessor.ProcessGraphUpdates (System.Boolean force) (at Assets/AstarPathfindingProject/Core/Misc/GraphUpdateProcessor.cs:190)
Pathfinding.WorkItemProcessor.ProcessWorkItems (System.Boolean force) (at Assets/AstarPathfindingProject/Core/Misc/WorkItemProcessor.cs:306)
AstarPath.PerformBlockingActions (System.Boolean force) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:860)
AstarPath.Update () (at Assets/AstarPathfindingProject/Core/AstarPath.cs:843)

It seems that it’s not enough to only add the links, the graphs need to be rescanned, especially if loaded from cache