commit 9e5de43974204a67866c44ad25065f4959d41600
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Apr 29 17:36:33 2025 +0200

    Fix crash when closing EmbeddedObjects
    
    This presumably does not fix the problem completely (we probably
    still get crashes if we have xrefs in such cases), but it is
    not necessary to query for children in this case where we return
    nothing anyway.
---
 src/insets/InsetRef.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index 741b702e65..841376b087 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -1015,6 +1015,9 @@ vector<FileName> InsetRef::externalFilenames(bool const 
warn) const
 
        // check whether the included file exist
        vector<string> incFileNames = 
getVectorFromString(ltrim(to_utf8(params()["filenames"])));
+       if (incFileNames.empty())
+               return res;
+
        ListOfBuffers const children = 
buffer().masterBuffer()->getDescendants();
        for (auto const & ifn : incFileNames) {
                string label;
@@ -1049,6 +1052,9 @@ vector<FileName> InsetRef::externalFilenames(bool const 
warn) const
 FileName InsetRef::getExternalFileName(docstring const & inlabel) const
 {
        vector<string> incFileNames = 
getVectorFromString(ltrim(to_utf8(params()["filenames"])));
+       if (incFileNames.empty())
+               return FileName();
+
        ListOfBuffers const children = 
buffer().masterBuffer()->getDescendants();
        for (auto const & ifn : incFileNames) {
                string label;
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to