aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_script.cpp
diff options
context:
space:
mode:
authoreska2016-06-05 14:52:07 +0200
committereska2016-06-05 19:17:33 +0200
commit3acbf8e71f15c682bcf4fee248f58180e689df1c (patch)
tree1dd425297f15d5c13cd43c3932f32b1cb8b55022 /modules/gdscript/gd_script.cpp
parent56348cbbfe82c2f5e2b95875e0687b664cc6e2d8 (diff)
downloadgodot-3acbf8e71f15c682bcf4fee248f58180e689df1c.tar.gz
godot-3acbf8e71f15c682bcf4fee248f58180e689df1c.tar.zst
godot-3acbf8e71f15c682bcf4fee248f58180e689df1c.zip
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) {