[generator] fix crash

This commit is contained in:
Mikhail Gorbushin 2019-05-17 13:26:08 +03:00 committed by Vladimir Byko-Ianko
parent 6166203b60
commit cba633dcae

View file

@ -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;