properties: editor == null if quick fix was created from resource bundle editor highlighter IDEA-162117

This commit is contained in:
Dmitry Batkovich
2016-11-28 16:33:23 +03:00
parent a1188bde9c
commit 9d447ceee2
2 changed files with 2 additions and 1 deletions
@@ -187,7 +187,7 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
return true;
}
private static void invokeIntention(@NotNull IntentionAction action, @NotNull Editor editor, @NotNull PsiFile file) {
private static void invokeIntention(@NotNull IntentionAction action, @Nullable Editor editor, @NotNull PsiFile file) {
PsiElement elementToMakeWritable = action.getElementToMakeWritable(file);
if (elementToMakeWritable != null && !FileModificationService.getInstance().preparePsiElementsForWrite(elementToMakeWritable)) {
return;
@@ -133,6 +133,7 @@ public class CleanupInspectionIntention implements IntentionAction, HighPriority
@Override
public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
return myQuickfixClass != EmptyIntentionAction.class &&
editor != null &&
!(myToolWrapper instanceof LocalInspectionToolWrapper && ((LocalInspectionToolWrapper)myToolWrapper).isUnfair());
}