Fix handling of empty password.
This commit is contained in:
+7
-5
@@ -46,12 +46,14 @@ impl<'a> LKEval<'a> {
|
|||||||
(_, Some(s)) => Some(s.to_string()),
|
(_, Some(s)) => Some(s.to_string()),
|
||||||
(None, None) => {
|
(None, None) => {
|
||||||
if read {
|
if read {
|
||||||
match (self.read_password)("/".to_string()) {
|
let name = "/".to_string();
|
||||||
|
match (self.read_password)(name.to_string()) {
|
||||||
Ok(password) => {
|
Ok(password) => {
|
||||||
let name = "/".to_string();
|
if password.len() > 0 {
|
||||||
self.cmd_correct(&out, &name, true, Some(password.clone()));
|
self.cmd_correct(&out, &name, true, Some(password.clone()));
|
||||||
self.state.lock().borrow_mut().secrets.insert(name, password.clone());
|
self.state.lock().borrow_mut().secrets.insert(name, password.clone());
|
||||||
Some(password)
|
Some(password)
|
||||||
|
} else { None }
|
||||||
}
|
}
|
||||||
Err(_) => None,
|
Err(_) => None,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user