diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp
index e24e53426ed3a02365e835b62d8f1fa1323c0c9c..8c456ee879866574ea87998555a0831c778c50b2 100644
--- a/indra/llcommon/lluriparser.cpp
+++ b/indra/llcommon/lluriparser.cpp
@@ -124,6 +124,18 @@ void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
 		return;
 	}
 
+	if(textRange.first == NULL)
+	{
+		LL_WARNS() << "textRange.first is NULL for uri: " << mNormalizedUri << LL_ENDL;
+		return;
+	}
+
+	if(textRange.afterLast == NULL)
+	{
+		LL_WARNS() << "textRange.afterLast is NULL for uri: " << mNormalizedUri << LL_ENDL;
+		return;
+	}
+
 	S32 len = textRange.afterLast - textRange.first;
 	if (len)
 	{