fix crash when pressing Down in command buffer and the history is empty

(reported by John McCabe-Dansted's monkey test)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30107 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-06-15 09:08:18 +00:00
parent 8bda8d10b8
commit 471e25647f

View File

@ -248,7 +248,8 @@ void GuiCommandBuffer::down()
if (!h.empty())
edit_->setText(toqstr(h));
downPB->setEnabled(history_pos_ != history_.end()-1);
downPB->setEnabled(!history_.empty()
&& history_pos_ != history_.end() - 1);
upPB->setEnabled(history_pos_ != history_.begin());
}