EA-58395 - NPE: PerlMatcher.matches

This commit is contained in:
peter
2014-07-21 22:14:07 +02:00
parent d203d8f937
commit c0d216205b
2 changed files with 4 additions and 3 deletions
@@ -1796,8 +1796,9 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
GotoActionModel model = new GotoActionModel(project, myFocusComponent, myEditor, myFile) {
@Override
protected MatchMode actionMatches(String pattern, @NotNull AnAction anAction) {
return NameUtil.buildMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE)
.matches(anAction.getTemplatePresentation().getText()) ? MatchMode.NAME : MatchMode.NONE;
String text = anAction.getTemplatePresentation().getText();
return text != null && NameUtil.buildMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE)
.matches(text) ? MatchMode.NAME : MatchMode.NONE;
}
};
return new GotoActionItemProvider(model);
@@ -459,7 +459,7 @@ public class GotoActionModel implements ChooseByNameModel, CustomMatcherModel, C
}
final String groupName = myActionsMap.get(anAction);
if (groupName == null) {
return matcher.matches(text, compiledPattern) ? MatchMode.NON_MENU : MatchMode.NONE;
return text != null && matcher.matches(text, compiledPattern) ? MatchMode.NON_MENU : MatchMode.NONE;
}
return text != null && matcher.matches(groupName + " " + text, compiledPattern) ? MatchMode.GROUP : MatchMode.NONE;
}