From 585963930e4547159189e2dcf5a4c1233999a7eb Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Thu, 16 Dec 2021 10:03:14 -0800 Subject: [PATCH] Fix issue 4987. --- .../org/checkerframework/framework/util/CheckerMain.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/CheckerMain.java b/framework/src/main/java/org/checkerframework/framework/util/CheckerMain.java index d2f850257bf..883ca5d5431 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/CheckerMain.java +++ b/framework/src/main/java/org/checkerframework/framework/util/CheckerMain.java @@ -537,7 +537,11 @@ private List expandWildcards(String pathElement) { */ private List jarFiles(String directory) { File dir = new File(directory); - return Arrays.asList(dir.list((d, name) -> name.endsWith(".jar") || name.endsWith(".JAR"))); + String[] jarFiles = dir.list((d, name) -> name.endsWith(".jar") || name.endsWith(".JAR")); + if (jarFiles == null) { + return Collections.emptyList(); + } + return Arrays.asList(jarFiles); } /** Invoke the compiler with all relevant jars on its classpath and/or bootclasspath. */