message helper now handles empty responses more gracefully
This commit is contained in:
parent
0fe3906578
commit
8e2826b110
1 changed files with 2 additions and 1 deletions
|
@ -26,7 +26,8 @@ pub fn message(fstr: &str) -> Option<String> {
|
|||
if let Ok(output) = result {
|
||||
let text = String::from_utf8(output.0.stdout);
|
||||
if let Ok(title) = text {
|
||||
Some(title[0..title.len() - 1].to_owned())
|
||||
if title.len() > 0 { Some(title[0..title.len() - 1].to_owned()) }
|
||||
else { None }
|
||||
} else { None }
|
||||
} else { None }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue