summaryrefslogtreecommitdiff
path: root/src/resources/emotedb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/emotedb.cpp')
-rw-r--r--src/resources/emotedb.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp
index 5b20742a8..6084f6092 100644
--- a/src/resources/emotedb.cpp
+++ b/src/resources/emotedb.cpp
@@ -76,6 +76,9 @@ void EmoteDB::load()
for_each_xml_child_node(spriteNode, emoteNode)
{
+ if (!spriteNode->xmlChildrenNode)
+ continue;
+
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
EmoteSprite *currentSprite = new EmoteSprite;
@@ -128,6 +131,9 @@ void EmoteDB::load()
for_each_xml_child_node(spriteNode, emoteNode)
{
+ if (!spriteNode->xmlChildrenNode)
+ continue;
+
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
EmoteSprite *currentSprite = new EmoteSprite;
@@ -160,13 +166,16 @@ void EmoteDB::unload()
i != mEmoteInfos.end();
++i)
{
- while (!i->second->sprites.empty())
+ if (i->second)
{
- delete i->second->sprites.front()->sprite;
- delete i->second->sprites.front();
- i->second->sprites.pop_front();
+ while (!i->second->sprites.empty())
+ {
+ delete i->second->sprites.front()->sprite;
+ delete i->second->sprites.front();
+ i->second->sprites.pop_front();
+ }
+ delete i->second;
}
- delete i->second;
}
mEmoteInfos.clear();