Skip to content

Commit

Permalink
Rate and channels is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed Dec 21, 2023
1 parent f045996 commit 17173da
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pwnodeobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,15 @@ impl PwNodeObject {
return;
}

let choice = pod.find_spa_property(&channels_key).expect("Channels!");
let channels = get_pod_maybe_choice(choice).int().expect("Channels int");
let channels = match pod.find_spa_property(&channels_key) {
Some(pod) => get_pod_maybe_choice(pod).int().expect("Channels int"),
None => 0
};

let choice = pod.find_spa_property(&rate_key).expect("Rate!");
let rate = get_pod_maybe_choice(choice).int().expect("Rate int");
let rate = match pod.find_spa_property(&rate_key) {
Some(pod) => get_pod_maybe_choice(pod).int().expect("Rate int"),
None => 0
};

let choice = pod.find_spa_property(&position_key).expect("Position!");
let positionpod = get_pod_maybe_choice(choice);
Expand Down

0 comments on commit 17173da

Please sign in to comment.