diff --git a/routing/osrm2feature_map.cpp b/routing/osrm2feature_map.cpp index dd2f61ee4b..eecf720126 100644 --- a/routing/osrm2feature_map.cpp +++ b/routing/osrm2feature_map.cpp @@ -445,6 +445,8 @@ TNodesList const & OsrmFtSegBackwardIndex::GetNodeIdByFid(const uint32_t fid) co ASSERT(m_table, ()); size_t const index = m_table->GetFeatureIndexbyOffset(fid); ASSERT_LESS(index, m_table->size(), ("Can't find feature index in offsets table")); + if (!m_rankIndex[index]) + return kEmptyList; size_t node_index = m_rankIndex.rank(index); ASSERT_LESS(node_index, m_nodeIds.size(), ()); return m_nodeIds[node_index]; diff --git a/routing/osrm2feature_map.hpp b/routing/osrm2feature_map.hpp index 7b29f894fb..c3c599a9bd 100644 --- a/routing/osrm2feature_map.hpp +++ b/routing/osrm2feature_map.hpp @@ -101,6 +101,7 @@ class OsrmFtSegBackwardIndex succinct::rs_bit_vector m_rankIndex; vector m_nodeIds; unique_ptr m_table; + const TNodesList kEmptyList; unique_ptr m_mappedBits;