]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Fix a crash when closing tabs
[lyx.git] / src / Buffer.cpp
index 8414efa20439fbe50cc696f74dd1debc96caafcc..5c7b88682b1e0e041f841ea92af61ebbcf2b8b30 100644 (file)
@@ -3538,6 +3538,9 @@ void Buffer::collectChildren(ListOfBuffers & children, bool grand_children) cons
        // loop over children
        for (auto const & p : d->children_positions) {
                Buffer * child = const_cast<Buffer *>(p.first);
+               // This can happen when called during GUI operations
+               if (!theBufferList().isLoaded(child))
+                       continue;
                // No duplicates
                ListOfBuffers::const_iterator bit = find(children.begin(), children.end(), child);
                if (bit != children.end())