summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-26 01:57:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-30 02:57:14 +0300
commit29ad6702ab90fc75fe9d0422609609fd15123fc3 (patch)
tree0b9cee6f48b0dd28455e5ef86800efc30f38064d /src/resources/mapreader.cpp
parent660dcd09eb2c156e3ca8bafe0c1a339041204d33 (diff)
downloadplus-29ad6702ab90fc75fe9d0422609609fd15123fc3.tar.gz
plus-29ad6702ab90fc75fe9d0422609609fd15123fc3.tar.bz2
plus-29ad6702ab90fc75fe9d0422609609fd15123fc3.tar.xz
plus-29ad6702ab90fc75fe9d0422609609fd15123fc3.zip
Some error fixes in atlases.
Check if image already in cache and check for mapinfo before using it.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index f81741227..ede630d0c 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -279,8 +279,11 @@ Map *MapReader::readMap(XmlNodePtr node, const std::string &path)
if (graphicsManager.getUseAtlases())
{
const MapDB::MapInfo *const info = MapDB::getMapAtlas(fileName);
- map->setAtlas(ResourceManager::getInstance()->getAtlas(
- info->atlas, *info->files));
+ if (info)
+ {
+ map->setAtlas(ResourceManager::getInstance()->getAtlas(
+ info->atlas, *info->files));
+ }
}
#endif