From 20adc1c9813697744a37c375027114370131695c Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" <–meierj@irs.uni-stuttgart.de> Date: Sat, 7 Aug 2021 14:28:12 +0200 Subject: [PATCH] queue nullptr check in action helper --- action/ActionHelper.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/action/ActionHelper.cpp b/action/ActionHelper.cpp index 73007ea3..aaa19ac4 100644 --- a/action/ActionHelper.cpp +++ b/action/ActionHelper.cpp @@ -33,6 +33,17 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) { setQueueToUse(queueToUse_); } + if(queueToUse == nullptr) { +#if FSFW_VERBOSE_LEVEL >= 1 +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::warning << "ActionHelper::initialize: No queue set" << std::endl; +#else + sif::printWarning("ActionHelper::initialize: No queue set\n"); +#endif +#endif /* FSFW_VERBOSE_LEVEL >= 1 */ + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; }