Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable

(cherry picked from commit 1e5767693e)
This commit is contained in:
A Thousand Ships
2023-09-12 15:33:49 +02:00
committed by David Snopek
parent 3b3f357de9
commit 205beacc5b
11 changed files with 21 additions and 21 deletions

View File

@@ -1519,13 +1519,13 @@ def generate_engine_class_source(class_api, used_classes, fully_used_classes, us
f"\t\tGDExtensionObjectPtr singleton_obj = internal::gdextension_interface_global_get_singleton({class_name}::get_class_static()._native_ptr());"
)
result.append("#ifdef DEBUG_ENABLED")
result.append("\t\tERR_FAIL_COND_V(singleton_obj == nullptr, nullptr);")
result.append("\t\tERR_FAIL_NULL_V(singleton_obj, nullptr);")
result.append("#endif // DEBUG_ENABLED")
result.append(
f"\t\tsingleton = reinterpret_cast<{class_name} *>(internal::gdextension_interface_object_get_instance_binding(singleton_obj, internal::token, &{class_name}::_gde_binding_callbacks));"
)
result.append("#ifdef DEBUG_ENABLED")
result.append("\t\tERR_FAIL_COND_V(singleton == nullptr, nullptr);")
result.append("\t\tERR_FAIL_NULL_V(singleton, nullptr);")
result.append("#endif // DEBUG_ENABLED")
result.append("\t}")
result.append("\treturn singleton;")