summaryrefslogtreecommitdiffstats
path: root/ffi/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ffi/src/error.rs')
-rw-r--r--ffi/src/error.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ffi/src/error.rs b/ffi/src/error.rs
index 05a1998a..e54139d1 100644
--- a/ffi/src/error.rs
+++ b/ffi/src/error.rs
@@ -20,7 +20,7 @@ pub extern "system" fn sq_error_free(error: *mut failure::Error) {
#[no_mangle]
pub extern "system" fn sq_error_string(error: Option<&failure::Error>)
-> *mut c_char {
- let error = error.expect("Error is NULL");
+ let error = ffi_param_ref!(error);
CString::new(format!("{}", error))
.map(|s| s.into_raw())
.unwrap_or(CString::new("Failed to convert error into string")
@@ -31,7 +31,7 @@ pub extern "system" fn sq_error_string(error: Option<&failure::Error>)
#[no_mangle]
pub extern "system" fn sq_error_status(error: Option<&failure::Error>)
-> Status {
- let error = error.expect("Error is NULL");
+ let error = ffi_param_ref!(error);
error.into()
}