Skip to content

Commit

Permalink
tailord: Gracefully handle missing performance profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronErhardt committed Jul 31, 2023
1 parent 30209f9 commit d7530a3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tailord/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ async fn start_runtime() {

let (performance_profile_handle, performance_profile_runtime) = match device {
Some(device) => {
let default_performance_profile = device.get_default_odm_performance_profile().unwrap();
let (handle, runtime) = PerformanceProfileRuntime::new(
device,
profile.performance_profile,
default_performance_profile,
);
(Some(handle), Some(runtime))
if let Ok(default_performance_profile) = device.get_default_odm_performance_profile() {
let (handle, runtime) = PerformanceProfileRuntime::new(
device,
profile.performance_profile,
default_performance_profile,
);
(Some(handle), Some(runtime))
} else {
(None, None)
}
}
None => (None, None),
};
Expand Down

0 comments on commit d7530a3

Please sign in to comment.