Merge pull request #53431 from MaxLap/new_instance_error_message

This commit is contained in:
Rémi Verschelde 2021-10-05 15:57:55 +02:00 committed by GitHub
commit 3ae1d2d899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()) {