Skip to content

Commit 7f1e74c

Browse files
committed
fix listfiles NPE
Signed-off-by: slievrly <slievrly@163.com>
1 parent b5ee837 commit 7f1e74c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

e2e-test/e2e-test-runner/src/main/java/org/apache/seata/controller/SkyWalkingController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ public void runE2ETests() {
5757
File e2eDir = new File(this.e2eDir);
5858
List<String> passedProjects = new ArrayList<>();
5959
File[] files = e2eDir.listFiles();
60+
if (files == null) {
61+
LOGGER.error("Failed to list files in directory: " + this.e2eDir);
62+
LOGGER.error("Please check if the directory exists and is accessible.");
63+
System.exit(1);
64+
return;
65+
}
66+
6067
// use this order to run saga test first, because saga test is easy to fail
6168
List<File> filterFiles = Arrays.stream(files).sorted((a, b) -> {
6269
int scoreA = caseOrder.getOrDefault(a.getName().charAt(0), 0);

0 commit comments

Comments
 (0)