Browse Source

Merge pull request #249 from greenfire27/xmlbugfix

Fixed Bug in XML
Mich 10 years ago
parent
commit
a9e8f24ecb
1 changed files with 8 additions and 4 deletions
  1. 8 4
      engine/source/persistence/SimXMLDocument.cpp

+ 8 - 4
engine/source/persistence/SimXMLDocument.cpp

@@ -811,11 +811,15 @@ const char* SimXMLDocument::getText()
    if(!pNode)
    if(!pNode)
       return "";
       return "";
 
 
-   TiXmlText* text = pNode->FirstChild()->ToText();
-   if( !text )
-      return "";
+   if (pNode->FirstChild() != NULL)
+   {
+	   TiXmlText* text = pNode->FirstChild()->ToText();
+	   if (!text)
+		   return "";
 
 
-   return text->Value();
+	   return text->Value();
+   }
+   else return "";
 }
 }
 
 
 void SimXMLDocument::removeText()
 void SimXMLDocument::removeText()