Skip to content
Snippets Groups Projects
Commit 22e69897 authored by AndreyL ProductEngine's avatar AndreyL ProductEngine
Browse files

MAINT-6605 Fix for the crash in LLClipboard::addToClipboard() - Added the exception handling

parent bcadc2c1
No related branches found
No related tags found
No related merge requests found
...@@ -123,7 +123,15 @@ bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool u ...@@ -123,7 +123,15 @@ bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool u
// Concatenate the input string to the LL and the system clipboard // Concatenate the input string to the LL and the system clipboard
bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
{ {
mString = src.substr(pos, len); try
{
mString = src.substr(pos, len);
}
catch (const std::exception& e)
{
LL_WARNS() << "Can't add the substring to clipboard: " << e.what() << LL_ENDL;
return false;
}
return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment