From 4c85637c9eab296d879d7b31344b920eb81f48f6 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Wed, 15 May 2013 18:48:07 +0300 Subject: [PATCH] [indexer] don't fail when loading new map, just ignore the new types --- indexer/classificator.cpp | 9 +++++++-- indexer/feature_visibility.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp index d6a9b9e063..c07ccc88b0 100644 --- a/indexer/classificator.cpp +++ b/indexer/classificator.cpp @@ -170,8 +170,13 @@ void ClassifObject::Swap(ClassifObject & r) ClassifObject const * ClassifObject::GetObject(size_t i) const { - ASSERT_LESS ( i, m_objs.size(), (m_name) ); - return &(m_objs[i]); + if (i < m_objs.size()) + return &(m_objs[i]); + else + { + LOG(LINFO, ("Map contains object that has no classificator entry", i, m_name)); + return 0; + } } void ClassifObject::ConcatChildNames(string & s) const diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index abeca95191..27750d245b 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -33,8 +33,13 @@ Classificator::ProcessObjects(uint32_t type, ToDo & toDo) const while (ftype::GetValue(type, i, v)) { p = p->GetObject(v); - path[i++] = p; - toDo(p); + if (p != 0) + { + path[i++] = p; + toDo(p); + } + else + break; } if (path.empty()) return res;