diff --git a/src/traceroute_results.cc b/src/traceroute_results.cc index 7774024..dfef6f8 100644 --- a/src/traceroute_results.cc +++ b/src/traceroute_results.cc @@ -62,8 +62,12 @@ std::shared_ptr TracerouteResults::match_packet(const Packet &packet) { // Try to match the received packet against the sent packets. The flow // is identified by the UDP destination port auto flow_id = inner_udp.dport(); - // FIXME this can throw std::out_of_range - hops_t hops(flows().at(flow_id)); + hops_t hops; + try { + hops = flows().at(flow_id); + } catch (std::out_of_range) { + return nullptr; + } unsigned int index = 0; for (auto &hop: *hops) {