Skip to content

Commit

Permalink
Fix panic in conn open try when no connection id is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorenesduarte committed Feb 5, 2021
1 parent 5b66aac commit 9114371
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/src/ics03_connection/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ pub trait ConnectionKeeper {
)?;
}
State::TryOpen => {
self.store_connection(
&result.connection_id.clone().unwrap(),
&result.connection_end,
)?;
let connection_id = result
.connection_id
.unwrap_or_else(|| self.next_connection_id());
self.store_connection(&connection_id, &result.connection_end)?;
// If this is the first time the handler processed this connection, associate the
// connection end to its client identifier.
self.store_connection_to_client(
&result.connection_id.clone().unwrap(),
&connection_id,
&result.connection_end.client_id(),
)?;
}
Expand Down

0 comments on commit 9114371

Please sign in to comment.