From e2edb083fffb36903fe5c88a34f41844ee874d76 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 11 Mar 2024 22:12:44 +0100 Subject: [PATCH] When prefetch fails, don't print error if variable is on blackboard --- blackboard/blackboard_plan.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blackboard/blackboard_plan.cpp b/blackboard/blackboard_plan.cpp index 473c366..8d85512 100644 --- a/blackboard/blackboard_plan.cpp +++ b/blackboard/blackboard_plan.cpp @@ -284,7 +284,10 @@ inline void bb_add_var_dup_with_prefetch(const Ref &p_blackboard, co if (n != nullptr) { var.set_value(n); } else { - ERR_PRINT(vformat("BlackboardPlan: Prefetch failed for variable $%s with value: %s", p_name, p_var.get_value())); + // Print error only if the variable is not present (it can be initialized by the user or in the parent scope). + if (!p_blackboard->has_var(p_name)) { + ERR_PRINT(vformat("BlackboardPlan: Prefetch failed for variable $%s with value: %s", p_name, p_var.get_value())); + } } p_blackboard->add_var(p_name, var); } else {