]> git.lyx.org Git - features.git/commitdiff
Don't access empty iterators.
authorRichard Heck <rgheck@comcast.net>
Thu, 14 Jan 2010 17:10:40 +0000 (17:10 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 14 Jan 2010 17:10:40 +0000 (17:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33033 a592a061-630c-0410-9148-cb99ea01b6c8

src/output_xhtml.cpp

index 86da7820864ec58810151de7d45f31aa4f670ba2..0b271dc8960e705c86a23d1b7afb3c6cfcc4d242 100644 (file)
@@ -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();