APM Planner: Attempting to fix crash

Attempting to fix one of APM Planner's many crashes...