Skip to content

Commit

Permalink
Fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger authored and algesten committed Dec 23, 2024
1 parent 8e8f82a commit 8c38cf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ice/pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ impl CandidatePair {

let next = if matches!(self.nomination_state, NominationState::Nominated) {
// Cheating a bit to make the nomination "skip the queue".
now.checked_sub(Duration::from_secs(60)).unwrap()
now.checked_sub(Duration::from_secs(60)).unwrap_or(now) // Must handle underflow gracefully, machine may be running for < 60s.
} else if let Some(last) = self.last_attempt_time() {
// When we have unanswered for longer than STUN_MAX_RTO_MILLIS / 2, start
// checking more often.
Expand Down

0 comments on commit 8c38cf3

Please sign in to comment.