Attempted to decrement past-the-end iterator of empty container.

This commit is contained in:
Aleric Inglewood
2012-11-10 22:22:56 +01:00
parent 04e7dc1270
commit a16c4015ba

View File

@@ -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;
}