Skip to content

Commit 4e80ec7

Browse files
committed
#3814 Out of range exception in TextCmdRemove::execute
1 parent b976d26 commit 4e80ec7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

indra/llui/lltexteditor.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,15 @@ class LLTextEditor::TextCmdRemove : public LLTextBase::TextCmd
209209
}
210210
virtual bool execute( LLTextBase* editor, S32* delta )
211211
{
212-
mWString = editor->getWText().substr(getPosition(), mLen);
213-
*delta = remove(editor, getPosition(), mLen );
212+
try
213+
{
214+
mWString = editor->getWText().substr(getPosition(), mLen);
215+
*delta = remove(editor, getPosition(), mLen);
216+
}
217+
catch (std::out_of_range&)
218+
{
219+
return false;
220+
}
214221
return (*delta != 0);
215222
}
216223
virtual S32 undo( LLTextBase* editor )

0 commit comments

Comments
 (0)