Skip to content

Commit

Permalink
Fix NRE when vessel is destroyed
Browse files Browse the repository at this point in the history
Don't just remove the CommNode from the net, also kill the vessel's connection field and the PM's comm node reference.  Otherwise it was getting re-added in RACN.Validate.
  • Loading branch information
DRVeyl committed Jan 29, 2022
1 parent 995b7dd commit f79fc5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/RealAntennasProject/RACommNetVessel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ protected override void OnDestroy()
GameEvents.onPlanetariumTargetChanged.Remove(OnMapFocusChange);
base.OnDestroy();
comm?.Net.Remove(comm);
comm = null;
vessel.connection = null;
}

protected override void UpdateComm()
Expand Down

0 comments on commit f79fc5a

Please sign in to comment.