summaryrefslogtreecommitdiff
path: root/src/resources/db/itemdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-16 18:21:50 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-16 18:21:50 +0300
commit05942467b37990f38fc80923f3d9ec63b160ad92 (patch)
tree3c6d3c3f55f83797d0a6444f1ddbd811267eb75d /src/resources/db/itemdb.cpp
parentb6e4d73c64444efa7c7bd10f09926564457ac251 (diff)
downloadmanaverse-05942467b37990f38fc80923f3d9ec63b160ad92.tar.gz
manaverse-05942467b37990f38fc80923f3d9ec63b160ad92.tar.bz2
manaverse-05942467b37990f38fc80923f3d9ec63b160ad92.tar.xz
manaverse-05942467b37990f38fc80923f3d9ec63b160ad92.zip
Add missing checks.
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r--src/resources/db/itemdb.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index f4e4116ac..9d9550e82 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -431,8 +431,11 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum)
}
else if (xmlNameEqual(itemChild, "particlefx"))
{
- display.particles.push_back(reinterpret_cast<const char*>(
- itemChild->xmlChildrenNode->content));
+ if (itemChild->xmlChildrenNode)
+ {
+ display.particles.push_back(reinterpret_cast<const char*>(
+ itemChild->xmlChildrenNode->content));
+ }
}
else if (xmlNameEqual(itemChild, "sound"))
{
@@ -745,6 +748,8 @@ static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
{
+ if (!node->xmlChildrenNode)
+ return;
const std::string event = XML::getProperty(node, "event", "");
const std::string filename = reinterpret_cast<const char*>(
node->xmlChildrenNode->content);
@@ -768,6 +773,8 @@ static void loadFloorSprite(SpriteDisplay *const display,
{
for_each_xml_child_node(spriteNode, floorNode)
{
+ if (!spriteNode->xmlChildrenNode)
+ continue;
if (xmlNameEqual(spriteNode, "sprite"))
{
SpriteReference *const currentSprite = new SpriteReference;