From 9c3122b89b9026d48949757ab56b115cc82ac4f4 Mon Sep 17 00:00:00 2001 From: Sarat Addepalli Date: Tue, 19 May 2015 12:49:32 +0530 Subject: [PATCH] Bypass asserts for `XMLDocument::Value()` When the node is an XMLDocument, bypass calling the `_value.GetStr()` function, since we know we have to return `( const char* )0` inevitably. This fixes #323 --- tinyxml2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 6e1985b..e6bb328 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -645,6 +645,8 @@ XMLNode::~XMLNode() const char* XMLNode::Value() const { + if ( this->ToDocument() ) + return ( const char* )0; return _value.GetStr(); }