From 1e5767693e45f58e2ffdc45d4c4f26057e25a2d6 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:33:49 +0200 Subject: Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable --- src/core/memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/memory.cpp') diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 17b0696..80e71ec 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -42,7 +42,7 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) { #endif void *mem = internal::gdextension_interface_mem_alloc(p_bytes + (prepad ? PAD_ALIGN : 0)); - ERR_FAIL_COND_V(!mem, nullptr); + ERR_FAIL_NULL_V(mem, nullptr); if (prepad) { uint8_t *s8 = (uint8_t *)mem; @@ -71,7 +71,7 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) { if (prepad) { mem -= PAD_ALIGN; mem = (uint8_t *)internal::gdextension_interface_mem_realloc(mem, p_bytes + PAD_ALIGN); - ERR_FAIL_COND_V(!mem, nullptr); + ERR_FAIL_NULL_V(mem, nullptr); return mem + PAD_ALIGN; } else { return (uint8_t *)internal::gdextension_interface_mem_realloc(mem, p_bytes); -- cgit v1.2.3