diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 765f4e4476c2688923d13fa63410389e08fc5b40..9b3dbcd2f67fc0b2103afc088f5d7f87ce36c605 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2113,14 +2113,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 		// arrow keys move avatar while chatting hack
 		if (chat_editor && chat_editor->hasFocus())
 		{
-			// let Control-Up and Control-Down through for chat line history
-			if (!(key == KEY_UP && mask == MASK_CONTROL)
-				&& !(key == KEY_DOWN && mask == MASK_CONTROL))
+			// If text field is empty, there's no point in trying to move
+			// cursor with arrow keys, so allow movement
+			if (chat_editor->getText().empty() 
+				|| gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
 			{
-				// If text field is empty, there's no point in trying to move
-				// cursor with arrow keys, so allow movement
-				if (chat_editor->getText().empty() 
-					|| gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
+				// let Control-Up and Control-Down through for chat line history,
+				if (!(key == KEY_UP && mask == MASK_CONTROL)
+					&& !(key == KEY_DOWN && mask == MASK_CONTROL))
 				{
 					switch(key)
 					{