summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2019-11-01 12:00:20 -0300
committerGeorge Marques <george@gmarqu.es>2019-11-01 12:00:20 -0300
commit15800b4db87f788f2229163592022dc743e9fde0 (patch)
tree0e332b1f83d5f4631fa173f018c0e096466226fe /modules/gdscript
parent5d5df05ee1ef38254cd6fffa3469556ecf986943 (diff)
GDScript: Avoid editor crashes when there's cyclic inheritance
Make sure the script is fully compiled before looking into the base.
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index db7f8d22e6..edb296437b 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -199,7 +199,7 @@ StringName GDScript::get_instance_base_type() const {
if (native.is_valid())
return native->get_name();
- if (base.is_valid())
+ if (base.is_valid() && base->is_valid())
return base->get_instance_base_type();
return StringName();
}
@@ -486,7 +486,7 @@ bool GDScript::_update_exports() {
placeholder_fallback_enabled = false;
- if (base_cache.is_valid()) {
+ if (base_cache.is_valid() && base_cache->is_valid()) {
if (base_cache->_update_exports()) {
changed = true;
}