diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java index ad1a307a029f..a06f2ae328c1 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java @@ -130,7 +130,7 @@ public class QuickFixAction extends AnAction implements CustomComponentAction { if (isProblemDescriptorsAcceptable() && descriptors.get().length > 0) { doApplyFix(view.getProject(), descriptors.get(), readOnlyFiles, tree.getContext()); } else { - doApplyFix(getSelectedElements(e), view); + doApplyFix(getSelectedElements(view), view); } } finally { view.setApplyingFix(false); @@ -222,11 +222,10 @@ public class QuickFixAction extends AnAction implements CustomComponentAction { return readOnlyFiles; } - private static RefEntity[] getSelectedElements(AnActionEvent e) { - final InspectionResultsView invoker = getInvoker(e); - if (invoker == null) return new RefElement[0]; - List selection = new ArrayList<>(Arrays.asList(invoker.getTree().getSelectedElements())); - PsiDocumentManager.getInstance(invoker.getProject()).commitAllDocuments(); + private static RefEntity[] getSelectedElements(InspectionResultsView view) { + if (view == null) return new RefElement[0]; + List selection = new ArrayList<>(Arrays.asList(view.getTree().getSelectedElements())); + PsiDocumentManager.getInstance(view.getProject()).commitAllDocuments(); Collections.sort(selection, (o1, o2) -> { if (o1 instanceof RefElement && o2 instanceof RefElement) { RefElement r1 = (RefElement)o1;