Skip to content

Commit

Permalink
Cleaner panic message for Envelope::source_address
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jan 7, 2024
1 parent 3fb20a0 commit 38a322f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libsignal-service/src/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ impl Envelope {
let uuid = self
.source_service_id
.as_deref()
.and_then(|u| Uuid::parse_str(u).ok())
.expect("valid uuid checked in constructor");
.map(Uuid::parse_str)
.transpose()
.expect("valid uuid checked in constructor")
.expect("source_service_id is set");

ServiceAddress { uuid }
}
Expand Down

0 comments on commit 38a322f

Please sign in to comment.