diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp
index 8270c630d84174ec4adaacf7f1bcad825392c4eb..d98bc297e53e6992f5b84768b8e868af986c81b0 100644
--- a/indra/llcommon/lluriparser.cpp
+++ b/indra/llcommon/lluriparser.cpp
@@ -118,38 +118,19 @@ void LLUriParser::fragment(const std::string& s)
 
 void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
 {
-	str = "";
-
-	if(&textRange == NULL)
-	{
-		return;
-	}
-
-	if(textRange.first == NULL)
-	{
-		return;
-	}
-
-	if(textRange.afterLast == NULL)
+	if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast)
 	{
-		return;
+		const ptrdiff_t len = textRange.afterLast - textRange.first;
+		str.assign(textRange.first, static_cast<std::string::size_type>(len));
 	}
-
-	S32 len = textRange.afterLast - textRange.first;
-	if (len)
+	else
 	{
-		str.assign(textRange.first, len);
+		str = LLStringUtil::null;
 	}
 }
 
 void LLUriParser::extractParts()
 {
-	if(&mUri == NULL)
-	{
-		LL_WARNS() << "mUri is NULL for uri: " << mNormalizedUri << LL_ENDL;
-		return;
-	}
-
 	if (mTmpScheme || mNormalizedTmp)
 	{
 		mScheme.clear();
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 88d2c4639d3152599420ec6619c2dd837e6f738c..4fc79964e236c836161e878c932bf54b81558df9 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -191,7 +191,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
 			if (start < match_start || match_entry == NULL)
 			{
 
-				if((mLLUrlEntryInvalidSLURL == *it))
+				if (mLLUrlEntryInvalidSLURL == *it)
 				{
 					if(url_entry && url_entry->isSLURLvalid(text.substr(start, end - start + 1)))
 					{