diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceMatchingUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceMatchingUtil.java index 2dbf53708181..96102b7f5e4e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceMatchingUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceMatchingUtil.java @@ -260,9 +260,8 @@ public class BraceMatchingUtil { return matcher.isPairBraces(tokenType1, tokenType2); } - private static int getTokenGroup(IElementType tokenType, FileType fileType) { - BraceMatcher matcher = getBraceMatcher(fileType, tokenType); - return matcher.getBraceTokenGroupId(tokenType); + private static int getTokenGroup(@Nullable IElementType tokenType, FileType fileType) { + return tokenType == null ? -1 : getBraceMatcher(fileType, tokenType).getBraceTokenGroupId(tokenType); } // TODO: better name for this method