fixed segfault when created doctype before owner doc has been set

This commit is contained in:
jez 2010-01-06 21:52:49 +00:00
parent 74f8a55ed4
commit 5ec2316aa5

View file

@ -178,6 +178,7 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl<stringT, string_adaptorT>
NodeImplT* setNode(typename NodeListT::iterator n, NodeImplT* arg) NodeImplT* setNode(typename NodeListT::iterator n, NodeImplT* arg)
{ {
if(ownerDoc_)
ownerDoc_->adopted(arg); ownerDoc_->adopted(arg);
if(n == nodes_.end()) if(n == nodes_.end())
{ {