* BUG: XmlNode.Attributes now works correctly when getting empty attributes.
* BUG: XmlElement.GetAttribute() now works correctly with empty attributes.

git-svn-id: svn://localhost/gambas/trunk@7912 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Adrien Prokopowicz 2016-09-13 12:37:08 +00:00
parent 6d5cc42da0
commit 98c990ceb1
2 changed files with 11 additions and 10 deletions

View file

@ -100,14 +100,15 @@ END_METHOD
BEGIN_METHOD(CElement_getAttribute, GB_STRING attrName; GB_INTEGER mode)
Attribute *attr = XMLElement_GetAttribute(THIS, STRING(attrName), LENGTH(attrName), VARG(mode));
if(attr)
{
GB.ReturnNewString(attr->attrValue, attr->lenAttrValue);
}
else
{
GB.ReturnNull();
}
if(attr && attr->attrValue && attr->lenAttrValue)
{
GB.ReturnNewString(attr->attrValue, attr->lenAttrValue);
}
else
{
GB.ReturnNull();
}
END_METHOD

View file

@ -205,9 +205,9 @@ if(THIS->type != Node::ElementNode) return;
Attribute *attr = XMLElement_GetAttribute((Element*)THIS, STRING(name), LENGTH(name));
if(attr)
if(attr && attr->attrValue && attr->lenAttrValue)
{
GB.ReturnNewString(attr->attrValue ? : "", attr->lenAttrValue);
GB.ReturnNewString(attr->attrValue, attr->lenAttrValue);
}
else
{