Commit 6b5828a8 authored by Dave Syer's avatar Dave Syer

Be defensive if there is no main/classes

parent 2845b101
......@@ -95,8 +95,11 @@ public abstract class MainClassFinder {
*/
public static <T> T doWithMainClasses(File rootFolder, ClassNameCallback<T> callback)
throws IOException {
if (!rootFolder.exists()) {
return null; // nothing to do
}
if (!rootFolder.isDirectory()) {
throw new IllegalArgumentException("Inavlid root folder '" + rootFolder + "'");
throw new IllegalArgumentException("Invalid root folder '" + rootFolder + "'");
}
String prefix = rootFolder.getAbsolutePath() + "/";
Deque<File> stack = new ArrayDeque<File>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment