Merge pull request #30 from MustafaSalih1993/dev
fixed mpd crash caused by unwraping
This commit is contained in:
commit
79632b2acc
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -397,7 +397,7 @@ checksum = "4e1b7878800220a76a08f32c057829511440f65528b63b940f2f2bc145d7ac68"
|
||||
|
||||
[[package]]
|
||||
name = "rsblocks"
|
||||
version = "0.1.6"
|
||||
version = "0.1.8"
|
||||
dependencies = [
|
||||
"alsa",
|
||||
"breadx",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rsblocks"
|
||||
version = "0.1.6"
|
||||
version = "0.1.8"
|
||||
authors = ["mustafa salih <mustafasalih1991@gmail.com>"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
@ -770,7 +770,13 @@ pub fn get_mpd_current(config: &Config) -> String {
|
||||
Ok(connection) => connection,
|
||||
_ => return String::from(""),
|
||||
};
|
||||
let current: Song = conn.currentsong().unwrap().unwrap();
|
||||
let current: Song = match conn.currentsong() {
|
||||
Ok(opt) => match opt {
|
||||
Some(song) => song,
|
||||
_ => return String::from(""),
|
||||
},
|
||||
_ => return String::from(""),
|
||||
};
|
||||
|
||||
let result = format!(
|
||||
" {} {} {}",
|
||||
|
Loading…
Reference in New Issue
Block a user