mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
Store Smtp.error as Option<String>
Without this change, when SMTP password is incorrect, as_str(sock.error) is called with a null pointer, and as_str panics. Now it does not crash when the error is not set.
This commit is contained in:
@@ -12,7 +12,7 @@ pub struct Smtp {
|
||||
transport_connected: bool,
|
||||
/// Email address we are sending from.
|
||||
from: Option<EmailAddress>,
|
||||
pub error: *mut libc::c_char,
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
impl Smtp {
|
||||
@@ -22,7 +22,7 @@ impl Smtp {
|
||||
transport: None,
|
||||
transport_connected: false,
|
||||
from: None,
|
||||
error: std::ptr::null_mut(),
|
||||
error: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user