fix(graphics): exit if connection to com.system76.PowerDaemon fails

This commit is contained in:
Ashley Wulber 2023-08-30 19:25:44 -04:00 committed by Ashley Wulber
parent 2d1b8680f9
commit 28446a33ab
2 changed files with 9 additions and 1 deletions

View file

@ -89,5 +89,9 @@ pub async fn init() -> Option<(Connection, PowerDaemonProxy<'static>)> {
_ => return None,
};
if matches!(proxy.introspect().await, Err(zbus::fdo::Error::ServiceUnknown(_))) {
return None;
}
Some((conn, proxy))
}