summaryrefslogtreecommitdiff
path: root/src/resources/mapdb.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/mapdb.cpp
parent660dcd09eb2c156e3ca8bafe0c1a339041204d33 (diff)
downloadmanaplus-29ad6702ab90fc75fe9d0422609609fd15123fc3.tar.gz
manaplus-29ad6702ab90fc75fe9d0422609609fd15123fc3.tar.bz2
manaplus-29ad6702ab90fc75fe9d0422609609fd15123fc3.tar.xz
manaplus-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/mapdb.cpp')
-rw-r--r--src/resources/mapdb.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/resources/mapdb.cpp b/src/resources/mapdb.cpp
index 2b2beed89..84b5f6cf3 100644
--- a/src/resources/mapdb.cpp
+++ b/src/resources/mapdb.cpp
@@ -121,8 +121,12 @@ void MapDB::readAtlas(XmlNodePtr node)
void MapDB::loadInfo()
{
XML::Document *doc = new XML::Document("maps.xml");
-
const XmlNodePtr root = doc->rootNode();
+ if (!root)
+ {
+ delete doc;
+ return;
+ }
for_each_xml_child_node(node, root)
{