From 869bb599c14199905d35819796fb686b0b36e958 Mon Sep 17 00:00:00 2001 From: Uli Kusterer Date: Tue, 21 Jan 2014 01:36:16 +0100 Subject: [PATCH] Make SetText() behave like the docs say. --- tinyxml2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 95075a5..0338beb 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1262,7 +1262,7 @@ const char* XMLElement::GetText() const void XMLElement::SetText( const char* inText ) { - if ( FirstChild() ) + if ( FirstChild() && FirstChild()->ToText() ) FirstChild()->SetValue( inText ); else { XMLText* theText = GetDocument()->NewText( inText );