From bf235a610f10301471ca83ce153511d63b3fa9f9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 14 Jun 2011 23:59:44 +0300 Subject: Add missing checks. --- src/map.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 2c8dc90e2..773e6ecdc 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1296,6 +1296,11 @@ void Map::addExtraLayer() { std::ifstream mapFile; mapFile.open(mapFileName.c_str(), std::ios::in); + if (!mapFile.is_open()) + { + mapFile.close(); + return; + } char line[201]; std::string buf; while (mapFile.getline(line, 200)) -- cgit v1.2.3-70-g09d2