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();