inspection tool window: check validity for before requesting a custom presentation

This commit is contained in:
Dmitry Batkovich
2016-05-05 14:43:06 +03:00
parent bbd50dacc2
commit b05ba7026f
@@ -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);
}