From 3bca05bc5020fdad8ce787d536f2f0be25ad2577 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 2 Jun 2024 21:58:50 +0200 Subject: [PATCH] Fix crash on adding a task with bad script base type and improve error handling --- editor/limbo_ai_editor_plugin.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 9748eeb..467af76 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -124,25 +124,35 @@ void LimboAIEditor::_add_task_with_prototype(const Ref &p_prototype) { } Ref LimboAIEditor::_create_task_by_class_or_path(const String &p_class_or_path) const { + ERR_FAIL_COND_V(p_class_or_path.is_empty(), nullptr); + Ref ret; if (p_class_or_path.begins_with("res:")) { Ref