diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 6039aa66184e8d3c649b6c7ed7a1aa130e8d9f2b..11a3c943ee29ecedcf267318dec2cec3d64a0266 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -4438,7 +4438,7 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM request, LPARAM param, LRESULT *res
 				LLWString context = find_context(wtext, preedit, preedit_length, &context_offset);
 				preedit -= context_offset;
 				preedit_length = llmin(preedit_length, (S32)context.length() - preedit);
-				if (preedit_length && preedit >= 0)
+				if (preedit_length > 0 && preedit >= 0)
 				{
 					// IMR_DOCUMENTFEED may be called when we have an active preedit.
 					// We should pass the context string *excluding* the preedit string.