From 40863313dd1836e770e06b5c17204749b06e1296 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 4 Aug 2024 12:41:25 +0200 Subject: [PATCH] Check if blackboard is null in `BehaviorTree.instantiate()` --- bt/behavior_tree.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bt/behavior_tree.cpp b/bt/behavior_tree.cpp index c6a5cf3..9daff79 100644 --- a/bt/behavior_tree.cpp +++ b/bt/behavior_tree.cpp @@ -81,6 +81,7 @@ Ref BehaviorTree::instantiate(Node *p_agent, const Ref & ERR_FAIL_COND_V_MSG(root_task == nullptr, nullptr, "BehaviorTree: Instantiation failed - BT has no valid root task."); ERR_FAIL_NULL_V_MSG(p_agent, nullptr, "BehaviorTree: Instantiation failed - agent can't be null."); ERR_FAIL_NULL_V_MSG(p_instance_owner, nullptr, "BehaviorTree: Instantiation failed -- instance owner can't be null."); + ERR_FAIL_NULL_V_MSG(p_blackboard, nullptr, "BehaviorTree: Instantiation failed - blackboard can't be null."); Node *scene_root = p_instance_owner->get_owner(); ERR_FAIL_NULL_V_MSG(scene_root, nullptr, "BehaviorTree: Instantiation failed - can't get scene root, because instance_owner not owned by a scene node. Hint: Try my_player.set_owner(get_owner())."); Ref root_copy = root_task->clone();