diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index a4f69e7ac1bbf68fa4be5c01fc99bfe8814ed10c..badbddc3ccd1dc44756054dfeb06bea9a4a458de 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -300,7 +300,8 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b
 	S32 paragraph_offset = 0;			//Offset into the paragraph text.
 
 	// Wrap lines that are longer than the view is wide.
-	while( paragraph_offset < (S32)mParagraphText.length() )
+	while( paragraph_offset < (S32)mParagraphText.length() &&
+		   mParagraphText[paragraph_offset] != 0)
 	{
 		S32 skip_chars; // skip '\n'
 		// Figure out if a word-wrapped line fits here.