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 8a1b1dd38221..2096cfecf274 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java @@ -471,7 +471,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren final int problemCount = myTree.getSelectedProblemCount(); JComponent previewPanel = null; final InspectionToolWrapper tool = myTree.getSelectedToolWrapper(); - if (tool != null && refEntity != null && problemCount == 1) { + if (tool != null && refEntity != null && problemCount == 1 && refEntity.isValid()) { final InspectionToolPresentation presentation = myGlobalInspectionContext.getPresentation(tool); previewPanel = presentation.getCustomPreviewPanel(refEntity); }