From 22b1ef0295f4608b418d3afeea1831e54ee1396d Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 14 Jan 2010 17:10:40 +0000 Subject: [PATCH] Don't access empty iterators. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33033 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/output_xhtml.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index 86da782086..0b271dc896 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -342,6 +342,14 @@ XHTMLStream & XHTMLStream::operator<<(EndTag const & etag) { if (etag.tag_.empty()) return *this; + + // make sure there are tags to be closed + if (tag_stack_.empty()) { + writeError("Tried to close `" + etag.tag_ + + "' when no tags were open!"); + return *this; + } + // first make sure we're not closing an empty tag if (!pending_tags_.empty()) { StartTag const & stag = pending_tags_.back(); -- 2.39.2