From 29dc8de88bdba441b64197712d52c43bbdf6ee1c Mon Sep 17 00:00:00 2001 From: Maxime Lapointe Date: Tue, 5 Oct 2021 08:09:09 -0400 Subject: [PATCH] Improve error message when instantiating virtual class --- core/object/class_db.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 8ba46e49eb3..d5509c50f1f 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -529,7 +529,7 @@ Object *ClassDB::instantiate(const StringName &p_class) { } ERR_FAIL_COND_V_MSG(!ti, nullptr, "Cannot get class '" + String(p_class) + "'."); ERR_FAIL_COND_V_MSG(ti->disabled, nullptr, "Class '" + String(p_class) + "' is disabled."); - ERR_FAIL_COND_V(!ti->creation_func, nullptr); + ERR_FAIL_COND_V_MSG(!ti->creation_func, nullptr, "Class '" + String(p_class) + "' or its base class cannot be instantiated."); } #ifdef TOOLS_ENABLED if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) {