Skip to content

Commit 99f1997

Browse files
committed
Fix bug in TestsReader
Use Optional.ofNullable to avoid throwing an NPE when a class file can't be read. Signed-off-by: Patrick Strawderman <[email protected]>
1 parent 885cdee commit 99f1997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/src/main/java/org/gradle/testretry/internal/testsreader/TestsReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private <R> Optional<R> readClasspathClass(String className, Supplier<? extends
9797
if (file.isDirectory()) {
9898
File classFile = new File(file, classFileName);
9999
if (classFile.exists()) {
100-
return Optional.of(visitClassFile(classFile, factory.get()));
100+
return Optional.ofNullable(visitClassFile(classFile, factory.get()));
101101
} else {
102102
continue;
103103
}

0 commit comments

Comments
 (0)