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" });