[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

@@ -1016,6 +1016,7 @@ void PreprocessElement(OsmElement * p, CalculateOriginFnT const & calcOrg)
if (value != "province")
return;
///@todo(pastk) some invalid relations might be empty so this might fail.
CHECK(calcOrg, ());
auto const org = calcOrg(p);
if (org && s_countriesChecker.IsTransformToState(*org))
@@ -1471,6 +1472,7 @@ void GetNameAndType(OsmElement * p, FeatureBuilderParams & params,
static CityBBox s_cityBBox;
///@todo(pastk) some invalid relations might be empty so this might fail.
CHECK(calcOrg, ());
auto const org = calcOrg(p);
if (org && s_cityBBox.IsInside(*org))