Skip to content

Commit 910ba6b

Browse files
committed
Prevent NPE inside GradleTestProgressListener
1 parent 853607e commit 910ba6b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

java/gradle.test/src/org/netbeans/modules/gradle/test/GradleTestProgressListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ private String searchLocation(Testcase tc, String className, String methodName,
365365

366366
String relativePath = null;
367367
for (Map.Entry<ClasspathInfo, Path> ci : classpathInfo.entrySet()) {
368+
if (ci.getKey() == null) continue;
368369
FileObject fo = SourceUtils.getFile(ElementHandle.createTypeElementHandle(ElementKind.CLASS, className), ci.getKey());
369370
if (fo != null) {
370371
relativePath = ci.getValue().relativize(FileUtil.toFile(fo).toPath()).toString();

0 commit comments

Comments
 (0)