summaryrefslogtreecommitdiff
path: root/core/object/class_db.cpp
diff options
context:
space:
mode:
authorMaxime Lapointe <hunter_spawn@hotmail.com>2021-10-05 08:09:09 -0400
committerMaxime Lapointe <hunter_spawn@hotmail.com>2021-10-05 08:09:35 -0400
commit29dc8de88bdba441b64197712d52c43bbdf6ee1c (patch)
treec3d628c69f9f7aad9c673839bd564ed8220ef67c /core/object/class_db.cpp
parent8a0db53d0f275f63bac6464fdd4e95b940dbfdec (diff)
Improve error message when instantiating virtual class
Diffstat (limited to 'core/object/class_db.cpp')
-rw-r--r--core/object/class_db.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp
index 8ba46e49eb..d5509c50f1 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()) {