fix: application None check when failed get the application name (#220)

* fix: application None check when failed get the application name

* Update src/client/hypr_client.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
pull/222/head
Zai-Chun Chen 1 year ago committed by GitHub
parent 49b3f11b3c
commit 3d55149056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,7 +19,9 @@ impl Client for HyprlandClient {
let s = serde_json::to_string(&win).ok()?;
let v: Value = serde_json::from_str(&s).ok()?;
let app = v["class"].as_str();
return Some(String::from(app.unwrap()));
if let Some(app) = app {
return Some(String::from(app));
}
}
None
}

Loading…
Cancel
Save