diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/lllineeditor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index e73b287..a3785e4 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp | |||
@@ -416,7 +416,16 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) | |||
416 | setCursor(llmin((S32)mText.length(), getCursor())); | 416 | setCursor(llmin((S32)mText.length(), getCursor())); |
417 | 417 | ||
418 | // Set current history line to end of history. | 418 | // Set current history line to end of history. |
419 | mCurrentHistoryLine = mLineHistory.end() - 1; | 419 | // RC Fix, its really not safe to just take 1 of the end itterator, if end==begin |
420 | // that leaves an invalid state upseting the secure STL checks | ||
421 | if(mLineHistory.empty()) | ||
422 | { | ||
423 | mCurrentHistoryLine = mLineHistory.begin(); | ||
424 | } | ||
425 | else | ||
426 | { | ||
427 | mCurrentHistoryLine = mLineHistory.end() - 1; | ||
428 | } | ||
420 | 429 | ||
421 | mPrevText = mText; | 430 | mPrevText = mText; |
422 | } | 431 | } |