diff --git a/src/BufferList.cpp b/src/BufferList.cpp index ecf7fdc4df..b47057a5ec 100644 --- a/src/BufferList.cpp +++ b/src/BufferList.cpp @@ -318,7 +318,8 @@ bool BufferList::releaseChild(Buffer * parent, Buffer * child) LASSERT(parent->isChild(child), return false); // Child document has a different parent, don't close it. - if (child->parent() != parent) + Buffer const * parent_ = child->parent(); + if (parent_ && parent_ != parent) return false; BufferStorage::iterator it = bstore.begin();