Skip to content

Commit

Permalink
Merge pull request #18 from qbx2/fix-invalidate_pending_binding_reque…
Browse files Browse the repository at this point in the history
…sts-panic

Fix invalidate_pending_binding_requests panicking sometimes
  • Loading branch information
Rusty Rain committed Oct 31, 2021
2 parents 72d6491 + f88628f commit e67c261
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/ice/src/agent/agent_internal.rs
Expand Up @@ -785,7 +785,11 @@ impl AgentInternal {

let mut temp = vec![];
for binding_request in pending_binding_requests.drain(..) {
if filter_time.duration_since(binding_request.timestamp) < MAX_BINDING_REQUEST_TIMEOUT {
if filter_time
.checked_duration_since(binding_request.timestamp)
.map(|duration| duration < MAX_BINDING_REQUEST_TIMEOUT)
.unwrap_or(true)
{
temp.push(binding_request);
}
}
Expand Down

0 comments on commit e67c261

Please sign in to comment.