]> git.lyx.org Git - features.git/commitdiff
XML: bad fix for a crash that only happened in XHTML.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Thu, 10 Sep 2020 22:39:41 +0000 (00:39 +0200)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sat, 19 Sep 2020 18:43:40 +0000 (20:43 +0200)
As an error is output, I suppose that this behaviour is OK.

src/xml.cpp

index 8e936f817e883f2d7e0fd8769536bad176a2f06b..dda39a4f3f6088e12da2e5a948071aa782c706b1 100644 (file)
@@ -477,7 +477,8 @@ XMLStream &XMLStream::operator<<(xml::EndTag const &etag)
                                                   + "' when other tags were pending. Last pending tag is `"
                                                   + to_utf8(pending_tags_.back()->writeTag())
                                                   + "'. Tag discarded.");
-                               pending_tags_.erase(dit);
+                               if (!pending_tags_.empty())
+                                       pending_tags_.erase(dit);
                                return *this;
                        }
                }