aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_script.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-06-06 21:15:13 -0300
committerJuan Linietsky2016-06-06 21:15:13 -0300
commite535c942f3c1b7e87a2971101192df5c259cdd30 (patch)
treeae1066a4cf8ff4e2fdc23a356e5e1894fbe4ebab /modules/gdscript/gd_script.cpp
parent2b9cab25c08f9319fcb9d89262d8eda5618a89ee (diff)
parentc86f1f1737ee58dca9ad6c4ddb3b475fc005453a (diff)
downloadgodot-e535c942f3c1b7e87a2971101192df5c259cdd30.tar.gz
godot-e535c942f3c1b7e87a2971101192df5c259cdd30.tar.zst
godot-e535c942f3c1b7e87a2971101192df5c259cdd30.zip
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
-rw-r--r--modules/gdscript/gd_script.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index dcd0641f7..12fc36d8c 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -145,11 +145,8 @@ Variant GDScript::_new(const Variant** p_args,int p_argcount,Variant::CallError&
_baseptr=_baseptr->_base;
}
- if (_baseptr->native.ptr()) {
- owner=_baseptr->native->instance();
- } else {
- owner=memnew( Reference ); //by default, no base means use reference
- }
+ ERR_FAIL_COND_V(_baseptr->native.is_null(), Variant());
+ owner=_baseptr->native->instance();
Reference *r=owner->cast_to<Reference>();
if (r) {