X-Git-Url: https://git.jetbrains.org/?p=idea%2Fcommunity.git;a=blobdiff_plain;f=RegExpSupport%2Fsrc%2Forg%2Fintellij%2Flang%2Fregexp%2FRegExpWordSelectionFilter.java;h=6ac84b85c7e13dd5b787f2a46a99a6a77417cd1f;hp=29ce387b74650f66f233604471e00017383a11a4;hb=2e0c3211fffc0aa0ca8d0c7197c866000b637078;hpb=f2849d732248677324274fe4929e1403144fec14 diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpWordSelectionFilter.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpWordSelectionFilter.java index 29ce387b7465..6ac84b85c7e1 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpWordSelectionFilter.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpWordSelectionFilter.java @@ -15,17 +15,20 @@ */ package org.intellij.lang.regexp; +import com.intellij.lang.ASTNode; import com.intellij.openapi.util.Condition; import com.intellij.psi.PsiElement; import org.intellij.lang.regexp.psi.RegExpChar; +import org.jetbrains.annotations.NotNull; /** * @author yole */ public class RegExpWordSelectionFilter implements Condition { @Override - public boolean value(PsiElement element) { - if (element.getNode().getElementType() == RegExpTT.CHARACTER || element instanceof RegExpChar) { + public boolean value(@NotNull PsiElement element) { + final ASTNode node = element.getNode(); + if ((node != null && node.getElementType() == RegExpTT.CHARACTER) || element instanceof RegExpChar) { return false; } return true;