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