* BUG: XmlReader: Reading empty attributes should not crash anymore.


git-svn-id: svn://localhost/gambas/trunk@8119 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Adrien Prokopowicz 2017-04-05 07:50:36 +00:00
parent 3db3310dcd
commit c6102c762f
2 changed files with 25 additions and 0 deletions

View file

@ -276,6 +276,12 @@ if(!THISOBJ->curAttrEnum)
return;
}
if(!THISOBJ->curAttrEnum->attrName || !THISOBJ->curAttrEnum->lenAttrName)
{
GB.ReturnNull();
return;
}
GB.ReturnNewString(THISOBJ->curAttrEnum->attrName, THISOBJ->curAttrEnum->lenAttrName);
END_PROPERTY
@ -289,6 +295,12 @@ if(!THISOBJ->curAttrEnum)
return;
}
if(!THISOBJ->curAttrEnum->attrValue || !THISOBJ->curAttrEnum->lenAttrValue)
{
GB.ReturnNull();
return;
}
GB.ReturnNewString(THISOBJ->curAttrEnum->attrValue, THISOBJ->curAttrEnum->lenAttrValue);
END_PROPERTY

View file

@ -194,6 +194,13 @@ if(!THIS->curAttrEnum)
return;
}
if(!THIS->curAttrEnum->attrName || !THIS->curAttrEnum->lenAttrName)
{
GB.ReturnNull();
return;
}
GB.ReturnNewString(THIS->curAttrEnum->attrName, THIS->curAttrEnum->lenAttrName);
END_PROPERTY
@ -207,6 +214,12 @@ if(!THIS->curAttrEnum)
return;
}
if(!THIS->curAttrEnum->attrValue || !THIS->curAttrEnum->lenAttrValue)
{
GB.ReturnNull();
return;
}
GB.ReturnNewString(THIS->curAttrEnum->attrValue, THIS->curAttrEnum->lenAttrValue);
END_PROPERTY