From b333719087bbe70c2e3d6ec03151b131670e2d26 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Mon, 9 Apr 2018 18:28:32 +0300 Subject: [PATCH] [generator] Fix type constructor --- generator/osm_source.cpp | 2 +- indexer/feature_visibility.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/generator/osm_source.cpp b/generator/osm_source.cpp index 41bbd3e5e8..5b7f601e5b 100644 --- a/generator/osm_source.cpp +++ b/generator/osm_source.cpp @@ -45,8 +45,8 @@ SourceReader::SourceReader() } SourceReader::SourceReader(string const & filename) +: m_file(unique_ptr(new ifstream(filename), Deleter())) { - m_file = unique_ptr(new ifstream(filename), Deleter()); CHECK(static_cast(m_file.get())->is_open() , ("Can't open file:", filename)); LOG_SHORT(LINFO, ("Reading OSM data from", filename)); } diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 9d8e34f1a6..8d6d16067e 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -222,6 +222,9 @@ namespace /// See also ftypes_matcher.cpp, IsInvisibleIndexedChecker. bool TypeAlwaysExists(uint32_t type, EGeomType g = GEOM_UNDEFINED) { + if (!classif().IsTypeValid(type)) + return false; + static const uint32_t roundabout = classif().GetTypeByPath({ "junction", "roundabout" }); static const uint32_t hwtag = classif().GetTypeByPath({ "hwtag" }); static const uint32_t psurface = classif().GetTypeByPath({ "psurface" });