summaryrefslogtreecommitdiff
path: root/src/resources/colordb.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-11-02 15:35:36 +0000
committerIra Rice <irarice@gmail.com>2008-11-02 15:35:36 +0000
commit25cda302161fe6be6f70a6228b8f40467c77929e (patch)
treedf9731698d118c56d59ca1215e67900a2f53e159 /src/resources/colordb.cpp
parent85381cb0cfeac608af58883810ffff134ac60ed3 (diff)
downloadMana-25cda302161fe6be6f70a6228b8f40467c77929e.tar.gz
Mana-25cda302161fe6be6f70a6228b8f40467c77929e.tar.bz2
Mana-25cda302161fe6be6f70a6228b8f40467c77929e.tar.xz
Mana-25cda302161fe6be6f70a6228b8f40467c77929e.zip
Fixed a potential crash.
Diffstat (limited to 'src/resources/colordb.cpp')
-rw-r--r--src/resources/colordb.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp
index 271becbf..d654762c 100644
--- a/src/resources/colordb.cpp
+++ b/src/resources/colordb.cpp
@@ -58,6 +58,11 @@ void ColorDB::load()
TMWHair = true;
XML::Document doc(TMW_COLOR_FILE);
root = doc.rootNode();
+ if (!root || !xmlStrEqual(root->name, BAD_CAST "colors"))
+ {
+ mLoaded = true;
+ return;
+ }
}
for_each_xml_child_node(node, root)
{