From b8e3fe8f262118b88693ef474feccc750ef3f14c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 5 Jun 2015 12:26:13 +0900 Subject: [PATCH] Mount: AlexMos fix to stop crashing before init --- libraries/AP_Mount/AP_Mount_Alexmos.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_Mount/AP_Mount_Alexmos.cpp b/libraries/AP_Mount/AP_Mount_Alexmos.cpp index bd8adb7f7c..235ea469a7 100644 --- a/libraries/AP_Mount/AP_Mount_Alexmos.cpp +++ b/libraries/AP_Mount/AP_Mount_Alexmos.cpp @@ -76,6 +76,10 @@ void AP_Mount_Alexmos::set_mode(enum MAV_MOUNT_MODE mode) // status_msg - called to allow mounts to send their status to GCS using the MOUNT_STATUS message void AP_Mount_Alexmos::status_msg(mavlink_channel_t chan) { + if (!_initialised) { + return; + } + get_angles(); mavlink_msg_mount_status_send(chan, 0, 0, _current_angle.y*100, _current_angle.x*100, _current_angle.z*100); }