Copter: avoid nullptr deref in config_error_loop

we may enter the config_error_loop before we call Copter's methods which allocate the wpnav object.

We send mavlink messages in the config error loop, one of which calls this method - so we end up with a nullptr dereference.

We might be able to find a way to stop sending this message in the config error loop, but that's likely to take some time to do....
This commit is contained in:
Peter Barker 2024-08-24 10:47:40 +10:00 committed by Andrew Tridgell
parent a33a0d1579
commit 46d37abcf7
1 changed files with 1 additions and 1 deletions

View File

@ -2330,7 +2330,7 @@ bool ModeAuto::resume()
bool ModeAuto::paused() const
{
return wp_nav->paused();
return (wp_nav != nullptr) && wp_nav->paused();
}
#endif