Skip to content

Commit bc3716c

Browse files
committed
apply fix mentioned in #916
1 parent 0c4a74e commit bc3716c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/xml_parsing.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ void XMLParser::PImpl::loadDocImpl(XMLDocument* doc, bool add_includes)
242242
}
243243

244244
const XMLElement* xml_root = doc->RootElement();
245+
if(!xml_root)
246+
{
247+
throw RuntimeError("Invalid XML: missing root element");
248+
}
245249

246250
auto format = xml_root->Attribute("BTCPP_format");
247251
if(!format)

0 commit comments

Comments
 (0)