better handle of null pointer

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-05-16 17:17:20 +08:00
parent 31b96a44de
commit 607f2d5d9d
2 changed files with 10 additions and 1 deletions

View File

@@ -81,7 +81,7 @@ impl PluginReturn {
(self.code, "".to_owned())
} else {
if self.msg.is_null() {
log::warn!("The message pointer is null");
log::warn!("The message pointer from the plugin is null, but the error code is {}", self.code);
return (self.code, "".to_owned())
}
let msg = cstr_to_string(self.msg).unwrap_or_default();