diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java index ff645a494e1d..a216b15adba7 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java @@ -486,7 +486,9 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren } private JComponent createBaseRightComponentFor(int problemCount, RefEntity selectedEntity) { - if (selectedEntity instanceof RefElement && !(((RefElement)selectedEntity).getElement() instanceof PsiDirectory)) { + if (selectedEntity instanceof RefElement && + selectedEntity.isValid() && + !(((RefElement)selectedEntity).getElement() instanceof PsiDirectory)) { PsiElement selectedElement = ((RefElement)selectedEntity).getElement(); if (problemCount == 1) { CommonProblemDescriptor[] descriptors = myTree.getSelectedDescriptors(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixToolbar.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixToolbar.java index eb1dd6ddba0e..181b7fecf479 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixToolbar.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixToolbar.java @@ -258,6 +258,7 @@ public class QuickFixToolbar extends JPanel implements InspectionTreeLoadingProg if (icon == null) { icon = AllIcons.Actions.CreateFromUsage; } + button.setEnabled(presentation.isEnabled()); button.setIcon(IconLoader.getTransparentIcon(icon, 0.75f)); new ClickListener() { @Override