diff options
author | Mikhail Gorbushin <m.gorbushin@corp.mail.ru> | 2019-05-17 13:26:08 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2019-05-17 13:37:42 +0300 |
commit | cba633dcaea7ea5f3fd13c747b1f204dac1abfa1 (patch) | |
tree | 4eceba24b24f5dc60041f0a04b2c659998ac689f /generator | |
parent | 6166203b60decba59b14a733c463988a9f7dc351 (diff) |
[generator] fix crash
Diffstat (limited to 'generator')
-rw-r--r-- | generator/restriction_collector.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/generator/restriction_collector.cpp b/generator/restriction_collector.cpp index 9327ee4013..6fa3683e5b 100644 --- a/generator/restriction_collector.cpp +++ b/generator/restriction_collector.cpp @@ -178,10 +178,15 @@ bool RestrictionCollector::FeaturesAreCross(m2::PointD const & coords, bool RestrictionCollector::IsRestrictionValid(m2::PointD const & coords, std::vector<uint32_t> const & featureIds) const { + if (featureIds.empty() || !m_indexGraph->IsRoad(featureIds[0])) + return false; + for (size_t i = 1; i < featureIds.size(); ++i) { auto prev = featureIds[i - 1]; auto cur = featureIds[i]; + if (!m_indexGraph->IsRoad(cur)) + return false; if (!FeaturesAreCross(coords, prev, cur)) return false; |