Skip to content

Commit

Permalink
fix: return error instead of panic
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcsmith committed Dec 20, 2023
1 parent 1406739 commit c0c70e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/scion-proto/src/path/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ impl PathFingerprint {
let mut hasher = Sha256::new();

for interface in metadata.interfaces.iter() {
assert!(interface.is_some());
let interface = interface.unwrap();
let Some(interface) = interface else {
return Err(FingerprintError);
};
hasher.update(interface.isd_asn.as_u64().to_be_bytes());
hasher.update(u64::from(interface.id).to_be_bytes());
}
Expand Down

0 comments on commit c0c70e6

Please sign in to comment.