mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Be defensive if there is no main/classes
This commit is contained in:
parent
2845b101a1
commit
6b5828a820
@ -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>();
|
||||
|
Loading…
Reference in New Issue
Block a user