mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable
(cherry picked from commit 1e5767693e)
This commit is contained in:
committed by
David Snopek
parent
3b3f357de9
commit
205beacc5b
@@ -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;")
|
||||
|
||||
Reference in New Issue
Block a user