diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 4fd6ebf199..886a15726a 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #if HAL_WITH_UAVCAN #include @@ -705,6 +706,13 @@ bool AP_Arming::system_checks(bool report) check_failed(ARMING_CHECK_SYSTEM, report, "Terrain out of memory"); return false; } +#endif +#ifdef ENABLE_SCRIPTING + const AP_Scripting *scripting = AP_Scripting::get_singleton(); + if ((scripting != nullptr) && scripting->enabled() && scripting->init_failed()) { + check_failed(ARMING_CHECK_SYSTEM, report, "Scripting out of memory"); + return false; + } #endif } if (AP::internalerror().errors() != 0) {