diff --git a/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java b/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java index 9b2365e0dd22..b85f4a7b0028 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java @@ -94,7 +94,10 @@ public abstract class TestTreeView extends Tree implements DataProvider, CopyPro for (TreePath path : paths) { AbstractTestProxy test = getSelectedTest(path); if (test != null) { - els.add((PsiElement)TestsUIUtil.getData(test, LangDataKeys.PSI_ELEMENT.getName(), myModel)); + final PsiElement psiElement = (PsiElement)TestsUIUtil.getData(test, LangDataKeys.PSI_ELEMENT.getName(), myModel); + if (psiElement != null) { + els.add(psiElement); + } } } return els.isEmpty() ? null : els.toArray(new PsiElement[els.size()]);