From 7cefc3172a0cb56971855f2fae6f86cfa9068588 Mon Sep 17 00:00:00 2001 From: bresch Date: Thu, 25 Apr 2024 09:54:42 +0200 Subject: [PATCH] estimatorCheck: get param only if handle is valid --- .../HealthAndArmingChecks/checks/estimatorCheck.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp index dc5b4566839f..c67fdfd21343 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp @@ -99,8 +99,12 @@ void EstimatorChecks::checkAndReport(const Context &context, Report &reporter) } } + param_t param_ekf2_en_handle = param_find_no_notification("EKF2_EN"); int32_t param_ekf2_en = 0; - param_get(param_find_no_notification("EKF2_EN"), ¶m_ekf2_en); + + if (param_ekf2_en_handle != PARAM_INVALID) { + param_get(param_ekf2_en_handle, ¶m_ekf2_en); + } if (missing_data && (param_ekf2_en == 1)) { /* EVENT