Skip to content

Commit

Permalink
refs #21: Fix access violation
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Sep 6, 2017
1 parent 019e545 commit 769d5e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ExternData/Resources/C-Sources/ED_XMLFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size
XmlNodeRef root = xml->root;
int iLevel = 0;
char* token = findValue(&root, varName, xml->fileName);
while (token == NULL && XmlNode_getChildCount(root) > 0) {
while (NULL == token && NULL != root && XmlNode_getChildCount(root) > 0) {
/* Try children if root is empty */
root = XmlNode_getChild(root, 0);
XmlNode_getValue(root, &token);
Expand Down Expand Up @@ -311,7 +311,7 @@ void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size
ModelicaError("Memory allocation error\n");
}
}
else {
else if (NULL != root) {
ModelicaFormatError("Error in line %i: Cannot read empty element \"%s\" in file \"%s\"\n",
XmlNode_getLine(root), varName, xml->fileName);
}
Expand Down

0 comments on commit 769d5e3

Please sign in to comment.