Originally posted by Goober5000
the old crash bug you're referring to? Because I don't think these are the same things.
Yeah that's the bug to which I was referring. It's a different instance of the same problem. The problem code isn't taking into account that the goal system either isn't set or got reset while still trying to execute. The goal system isn't setup for a ship that is just warping in. When the warp in proceedure is done then it's setup but with that other bug it would try and process the ship before that point. That bug was because it would keep looping through until it got into the dock mode, the fix was to avoid that case until the goal system had been readied.
This new problem is the same thing, when the warp out proceedure gets to a certain point the goal gets reset but it will still try and process the docking mode. The extra NULL check in this case would prevent it from contiuning to dock at this point but the better fix would be, as you mention, to make sure that docking is aborted when the rearm goal is removed.
The old way took all of this into account I believe. I don't know if it was intentionally handled but it did work.