summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-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 3fb9268702..bc28f7009e 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -69,7 +69,7 @@ Variant GDScriptNativeClass::_new() {
Object *o = instance();
if (!o) {
ERR_EXPLAIN("Class type: '" + String(name) + "' is not instantiable.");
- ERR_FAIL_COND_V(!o, Variant());
+ ERR_FAIL_V(Variant());
}
Reference *ref = Object::cast_to<Reference>(o);
@@ -332,7 +332,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) {
}
Variant::CallError unchecked_error;
- return _create_instance(NULL, 0, p_this, Object::cast_to<Reference>(p_this), unchecked_error);
+ return _create_instance(NULL, 0, p_this, Object::cast_to<Reference>(p_this) != NULL, unchecked_error);
}
PlaceHolderScriptInstance *GDScript::placeholder_instance_create(Object *p_this) {