mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-58395 - NPE: PerlMatcher.matches
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user