unwrap crasher fix

This commit is contained in:
Christien Rioux 2024-06-25 21:44:42 +00:00
parent bca3877024
commit ecbe2fdc03

View File

@ -215,13 +215,14 @@ impl Network {
did.dial_info.protocol_type().low_level_protocol_type(),
dr.local_port,
);
for additional_pt in
inbound_protocol_map.get(&ipmkey).unwrap().iter().skip(1)
{
if let Some(ipm) = inbound_protocol_map.get(&ipmkey) {
for additional_pt in ipm.iter().skip(1) {
// Make dialinfo for additional protocol type
let additional_ddi = DetectedDialInfo::Detected(DialInfoDetail {
dial_info: self
.make_dial_info(did.dial_info.socket_address(), *additional_pt),
dial_info: self.make_dial_info(
did.dial_info.socket_address(),
*additional_pt,
),
class: did.class,
});
// Add additional dialinfo
@ -229,6 +230,7 @@ impl Network {
}
}
}
}
Ok(Some(None)) => {
// Found no new dial info for this protocol/address combination
}