MCPcopy Create free account
hub / github.com/apache/paimon-rust / check_non_null

Function check_non_null

bindings/c/src/error.rs:110–119  ·  view source on GitHub ↗

Check that a pointer is non-null, returning an error if it is.

(ptr: *const T, name: &str)

Source from the content-addressed store, hash-verified

108
109/// Check that a pointer is non-null, returning an error if it is.
110pub fn check_non_null<T>(ptr: *const T, name: &str) -> Result<(), *mut paimon_error> {
111 if ptr.is_null() {
112 Err(paimon_error::new(
113 PaimonErrorCode::InvalidInput,
114 format!("null pointer passed for `{name}`"),
115 ))
116 } else {
117 Ok(())
118 }
119}

Calls 1

is_nullMethod · 0.80

Tested by

no test coverage detected