summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-26 17:52:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-26 17:52:43 +0200
commit7a4d55db5611435bf79a750204a84ca769b14ed9 (patch)
treee62fccf23a2f155d5c5799aebe5b0837e33c6377 /modules/gdscript/gdscript.cpp
parent36945dad0730ee013547493df60c4c59567b4290 (diff)
parent517e9f8aefed8925c1b66932a0d3cb887e99d267 (diff)
downloadredot-engine-7a4d55db5611435bf79a750204a84ca769b14ed9.tar.gz
Merge pull request #81760 from AThousandShips/null_check_modules
[Modules] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
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 62d2c14c17..22be26fdc1 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -83,7 +83,7 @@ void GDScriptNativeClass::_bind_methods() {
Variant GDScriptNativeClass::_new() {
Object *o = instantiate();
- ERR_FAIL_COND_V_MSG(!o, Variant(), "Class type: '" + String(name) + "' is not instantiable.");
+ ERR_FAIL_NULL_V_MSG(o, Variant(), "Class type: '" + String(name) + "' is not instantiable.");
RefCounted *rc = Object::cast_to<RefCounted>(o);
if (rc) {
@@ -215,7 +215,7 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallErr
} else {
owner = memnew(RefCounted); //by default, no base means use reference
}
- ERR_FAIL_COND_V_MSG(!owner, Variant(), "Can't inherit from a virtual class.");
+ ERR_FAIL_NULL_V_MSG(owner, Variant(), "Can't inherit from a virtual class.");
RefCounted *r = Object::cast_to<RefCounted>(owner);
if (r) {