AP_Scripting: fixed error on bad cmd in mission

This commit is contained in:
Andrew Tridgell 2022-12-17 10:22:32 +11:00
parent 6ddf2e039f
commit 6dcb137b29
1 changed files with 4 additions and 0 deletions

View File

@ -2392,6 +2392,10 @@ function check_auto_mission()
last_id = id last_id = id
local initial_yaw_deg = get_ground_course_deg() local initial_yaw_deg = get_ground_course_deg()
load_trick(cmd) load_trick(cmd)
if command_table[cmd] == nil then
gcs:send_text(0, string.format("Trick %u not found", cmd))
return
end
gcs:send_text(0, string.format("Starting %s!", command_table[cmd].name )) gcs:send_text(0, string.format("Starting %s!", command_table[cmd].name ))
-- work out yaw between previous WP and next WP -- work out yaw between previous WP and next WP