diff --git a/src/plugins/qmljseditor/qmljseditorcodeformatter.cpp b/src/plugins/qmljseditor/qmljseditorcodeformatter.cpp
index 175e384a5964e7f819b5f28fe5a542e43f2fa5e6..638b4fdd7303fccfae9d5da07710528e6b31ac21 100644
--- a/src/plugins/qmljseditor/qmljseditorcodeformatter.cpp
+++ b/src/plugins/qmljseditor/qmljseditorcodeformatter.cpp
@@ -93,7 +93,7 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
         if (parentState.type == binding_assignment)
             *savedIndentDepth = state(1).savedIndentDepth;
 
-        bool followedByData = (!lastToken && !tokenAt(tokenIndex() + 1).kind == Token::Comment);
+        bool followedByData = (!lastToken && tokenAt(tokenIndex() + 1).kind != Token::Comment);
         if (firstToken || followedByData)
             *savedIndentDepth = tokenPosition;