From 236d54322a81ce5768f5ad0f2dda49ff3fac8eb1 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 24 Mar 2016 15:02:59 +0100 Subject: [PATCH] EA-80965 - IAE: BraceMatchingUtil.getBraceMatcher --- .../intellij/codeInsight/highlighting/BraceMatchingUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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