summaryrefslogtreecommitdiffstats
path: root/core/io/marshalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/marshalls.cpp')
-rw-r--r--core/io/marshalls.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 6ca7b0f831..bfef9ebeaf 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -640,7 +640,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
} else {
Object *obj = ClassDB::instantiate(str);
- ERR_FAIL_COND_V(!obj, ERR_UNAVAILABLE);
+ ERR_FAIL_NULL_V(obj, ERR_UNAVAILABLE);
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
int32_t count = decode_uint32(buf);
@@ -1576,7 +1576,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
buf += len;
}
Variant *v = d.getptr(E);
- ERR_FAIL_COND_V(!v, ERR_BUG);
+ ERR_FAIL_NULL_V(v, ERR_BUG);
err = encode_variant(*v, buf, len, p_full_objects, p_depth + 1);
ERR_FAIL_COND_V(err, err);
ERR_FAIL_COND_V(len % 4, ERR_BUG);