Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Magidovich <mgsergio@mapswithme.com>2016-06-10 12:21:25 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-06-23 19:23:40 +0300
commit2ab4066e02f5d2f40e227ee37e4608d7caa07416 (patch)
tree8161d68bdcbe778513014a4dd555295a8b47143e /indexer/osm_editor.cpp
parentfe7e960ce0834b6237e7cc603b58df1557f47a7b (diff)
Fix crash while loading feature created on deleted mwm.
Diffstat (limited to 'indexer/osm_editor.cpp')
-rw-r--r--indexer/osm_editor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp
index 3de6497b13..5fa071628c 100644
--- a/indexer/osm_editor.cpp
+++ b/indexer/osm_editor.cpp
@@ -131,6 +131,13 @@ bool IsObsolete(editor::XMLFeature const & xml, FeatureID const & fid)
return uploadTime != my::INVALID_TIME_STAMP &&
my::TimeTToSecondsSinceEpoch(uploadTime) < GetMwmCreationTimeByMwmId(fid.m_mwmId);
}
+
+m2::PointD GetSomeFeaturePoint(editor::XMLFeature const & xml)
+{
+ if (xml.GetType() == XMLFeature::Type::Node)
+ return xml.GetMercatorCenter();
+ return xml.GetGeometry().front();
+}
} // namespace
namespace osm
@@ -197,6 +204,14 @@ void Editor::LoadMapEdits()
{
XMLFeature const xml(nodeOrWay.node());
+ // TODO(mgsergio): A map could be renamed, we'll treat it as deleted.
+ // The right thing to do is to try to migrate all changes anyway.
+ if (!mwmId.IsAlive())
+ {
+ LOG(LINFO, ("Mwm", mapName, "was deleted"));
+ goto SECTION_END;
+ }
+
// TODO(mgsergio): Deleted features are not properly handled yet.
auto const fid = needMigrateEdits
? editor::MigrateFeatureIndex(
@@ -251,6 +266,8 @@ void Editor::LoadMapEdits()
}
} // for nodes
} // for sections
+ SECTION_END:
+ ;
} // for mwms
// Save edits with new indexes and mwm version to avoid another migration on next startup.