Fix error when trying to add fav task while no BT is edited

This commit is contained in:
Serhii Snitsaruk 2023-10-29 13:45:32 +01:00
parent e05a6fd6ea
commit dca3ba38c0
1 changed files with 3 additions and 1 deletions

View File

@ -44,8 +44,10 @@ _FORCE_INLINE_ String _get_script_template_path() {
}
void LimboAIEditor::_add_task(const Ref<BTTask> &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<BTTask> parent = task_tree->get_selected();