summaryrefslogtreecommitdiff
path: root/indra/llui/llurlentry.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-02-22 21:48:46 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-02-23 19:18:23 +0200
commitae7b318e7f21d0d372d48a635ff1e2ea59c4acf6 (patch)
treeafa967ba22f54cd2dee34cd73d790f0cfd9688e6 /indra/llui/llurlentry.cpp
parentae6aa3fc411baad073d24f10b4534e86fe77564c (diff)
viewer#875 Crash at uri normalization
Note that crash happened when setting LLProgressView::setMessage
Diffstat (limited to 'indra/llui/llurlentry.cpp')
-rw-r--r--indra/llui/llurlentry.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 77e9edf5e5..05d821f5d8 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -234,14 +234,20 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const
std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
{
+ if (url.empty())
+ {
+ return url;
+ }
LLUriParser up(escapeUrl(url));
- up.normalize();
-
- std::string label;
- up.extractParts();
- up.glueFirst(label);
+ if (up.normalize() == 0)
+ {
+ std::string label;
+ up.extractParts();
+ up.glueFirst(label);
- return unescapeUrl(label);
+ return unescapeUrl(label);
+ }
+ return std::string();
}
std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const