From a16c4015ba6fdb2013c83bb796542bfb2ddda5e4 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 10 Nov 2012 22:22:56 +0100 Subject: [PATCH] Attempted to decrement past-the-end iterator of empty container. --- indra/llui/lllineeditor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index f54d2c761..acc842818 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -352,8 +352,11 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) } setCursor(llmin((S32)mText.length(), getCursor())); - // Set current history line to end of history. - mCurrentHistoryLine = mLineHistory.end() - 1; + if (!mLineHistory.empty()) + { + // Set current history line to end of history. + mCurrentHistoryLine = mLineHistory.end() - 1; + } mPrevText = mText; }