From 9d447ceee2e10b4119f66261b7482cd34c1b0fe4 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Mon, 28 Nov 2016 16:32:49 +0300 Subject: [PATCH] properties: editor == null if quick fix was created from resource bundle editor highlighter IDEA-162117 --- .../codeInsight/intention/impl/ShowIntentionActionsHandler.java | 2 +- .../codeInspection/actions/CleanupInspectionIntention.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java index d0b1fc667ff6..8380581feb60 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java @@ -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; diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionIntention.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionIntention.java index 2143d6c3f5f1..d9315caf565c 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionIntention.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionIntention.java @@ -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()); }