Don't access empty iterators.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33033 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-01-14 17:10:40 +00:00
parent 02124ea00e
commit 22b1ef0295

View 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();