check for empty name_id before getting data

This commit is contained in:
karenzshea
2017-11-30 13:10:46 +01:00
committed by Patrick Niklaus
parent 56459d37d1
commit 89080fb2b0
10 changed files with 158 additions and 135 deletions
@@ -77,13 +77,13 @@ TurnType::Enum IntersectionHandler::findBasicTurnType(const EdgeID via_edge,
const auto &out_name_id =
node_data_container.GetAnnotation(node_based_graph.GetEdgeData(road.eid).annotation_data)
.name_id;
const auto &in_name = name_table.GetNameForID(in_name_id).to_string();
const auto &out_name = name_table.GetNameForID(out_name_id).to_string();
const auto &in_name_empty = name_table.GetNameForID(in_name_id).to_string().empty();
const auto &out_name_empty = name_table.GetNameForID(out_name_id).to_string().empty();
const auto same_name = !util::guidance::requiresNameAnnounced(
in_name_id, out_name_id, name_table, street_name_suffix_table);
if (!in_name.empty() && !out_name.empty() && same_name)
if (!in_name_empty && !out_name_empty && same_name)
{
return TurnType::Continue;
}