From f01570446e9c15afcbd9102f81b7d3d0eee86878 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz Date: Mon, 6 Aug 2012 19:04:28 +0000 Subject: [PATCH] [GB.XML] * BUG: Fix the XmlReader.Node.IsEmptyElement property. git-svn-id: svn://localhost/gambas/trunk@5010 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.xml/src/CReader.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gb.xml/src/CReader.cpp b/gb.xml/src/CReader.cpp index f14505080..838ce823a 100644 --- a/gb.xml/src/CReader.cpp +++ b/gb.xml/src/CReader.cpp @@ -278,9 +278,15 @@ GB.ReturnObject(0); END_PROPERTY -BEGIN_PROPERTY(CReader_isEmptyElement) +BEGIN_PROPERTY(CReaderNode_IsEmptyElement) -if(!THIS->foundNode->isElement()) +if(!THIS->foundNode) +{ + GB.ReturnBoolean(false); + return; +} + +if(!THIS->foundNode->isElement()) { GB.ReturnBoolean(false); return; @@ -349,7 +355,7 @@ GB_DESC CReaderNodeDesc[] = //GB_PROPERTY_READ("BaseUri","s",CRNODE_BaseUri), GB_PROPERTY_READ("Depth","i",CReader_Depth), //GB_PROPERTY_READ("IsDefault","b",CRNODE_IsDefault), - //GB_PROPERTY_READ("IsEmptyElement","b",CRNODE_IsEmptyElement), + GB_PROPERTY_READ("IsEmptyElement","b",CReaderNode_IsEmptyElement), //GB_PROPERTY_READ("LocalName","s",CRNODE_LocalName), GB_PROPERTY_READ("Name", "s", CReaderNode_Name), //GB_PROPERTY_READ("NamespaceUri", "s", CRNODE_NamespaceUri),