fixup this PR with tests, and returning None from get_filemime

This commit is contained in:
holger krekel
2019-09-26 00:33:58 +02:00
parent 53b5cbc12a
commit 02b73207f9
3 changed files with 16 additions and 9 deletions

View File

@@ -2362,7 +2362,11 @@ pub unsafe extern "C" fn dc_msg_get_filemime(msg: *mut dc_msg_t) -> *mut libc::c
return dc_strdup(ptr::null());
}
let ffi_msg = &*msg;
ffi_msg.message.get_filemime().strdup()
if let Some(x) = ffi_msg.message.get_filemime() {
x.strdup()
} else {
return dc_strdup(ptr::null());
}
}
#[no_mangle]