[generator] Fix Features stage crash on an empty relation

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-07 17:57:35 +07:00
committed by Konstantin Pastbin
parent d5ce81b20b
commit d7f73f4b9b
2 changed files with 9 additions and 1 deletions

View File

@@ -51,7 +51,13 @@ std::optional<m2::PointD> FeatureMakerSimple::GetOrigin(OsmElement const & e) co
}
else
{
CHECK(!e.m_members.empty(), (e.m_id));
if (e.m_members.empty())
{
// Such relations are considered invalid but could be present in OSM data still,
// see https://wiki.openstreetmap.org/wiki/Empty_relations
LOG(LWARNING, ("Invalid relation with no members", e.m_id));
return {};
}
for (auto const & m : e.m_members)
{
if (m.m_type == OsmElement::EntityType::Node)