From: Richard Heck Date: Thu, 14 Jan 2010 17:10:40 +0000 (+0000) Subject: Don't access empty iterators. X-Git-Tag: 2.0.0~4365 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=22b1ef0295f4608b418d3afeea1831e54ee1396d;p=features.git Don't access empty iterators. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33033 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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();