From dca3ba38c0bc545315a33ff0fc198c86fc4f3afc Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 29 Oct 2023 13:45:32 +0100 Subject: [PATCH] Fix error when trying to add fav task while no BT is edited --- editor/limbo_ai_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index fbdb757..bf66f12 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -44,8 +44,10 @@ _FORCE_INLINE_ String _get_script_template_path() { } void LimboAIEditor::_add_task(const Ref &p_task) { + if (task_tree->get_bt().is_null()) { + return; + } ERR_FAIL_COND(p_task.is_null()); - ERR_FAIL_COND(task_tree->get_bt().is_null()); EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); undo_redo->create_action(TTR("Add BT Task")); Ref parent = task_tree->get_selected();