summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-08-02 06:22:43 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-08-02 06:22:43 +0300
commit22e69897db61a62794116eb81e8b413ac180b8e7 (patch)
treec2b94aa5df35e0a7603bc71661c2915bf6f65e62 /indra/llui
parentbcadc2c1b35d458d0a90293f77778f4313f47ba4 (diff)
MAINT-6605 Fix for the crash in LLClipboard::addToClipboard() - Added the exception handling
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llclipboard.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 1d18cb2bb0..06fac190ed 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -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
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));
}