From 7ffd3c618d76793a2bbe6eb8cbdfd174b792da08 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Mon, 6 Aug 2018 17:10:28 +0300 Subject: [PATCH] EA-125356 - NPE: ShowDiscoveredTestsAction.lambda$findMethods$ --- .../testDiscovery/actions/ShowDiscoveredTestsAction.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowDiscoveredTestsAction.java b/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowDiscoveredTestsAction.java index 3f2dddb1e3f6..b28824425f36 100644 --- a/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowDiscoveredTestsAction.java +++ b/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowDiscoveredTestsAction.java @@ -154,7 +154,9 @@ public class ShowDiscoveredTestsAction extends AnAction { return methods .stream() - .map(m -> ObjectUtils.tryCast(Objects.requireNonNull(UastContextKt.toUElement(m)).getJavaPsi(), PsiMethod.class)) + .map(m -> UastContextKt.toUElement(m)) + .filter(Objects::nonNull) + .map(m -> ObjectUtils.tryCast(m.getJavaPsi(), PsiMethod.class)) .filter(Objects::nonNull) .toArray(PsiMethod.ARRAY_FACTORY::create); }