summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
Diffstat (limited to 'core/object')
-rw-r--r--core/object/class_db.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp
index dc28fa10de..f5171f60ec 100644
--- a/core/object/class_db.cpp
+++ b/core/object/class_db.cpp
@@ -243,8 +243,11 @@ HashMap<StringName, StringName> ClassDB::resource_base_extensions;
HashMap<StringName, StringName> ClassDB::compat_classes;
bool ClassDB::_is_parent_class(const StringName &p_class, const StringName &p_inherits) {
- StringName inherits = p_class;
+ if (!classes.has(p_class)) {
+ return false;
+ }
+ StringName inherits = p_class;
while (inherits.operator String().length()) {
if (inherits == p_inherits) {
return true;