1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-10 21:24:12 +01:00

Check for containing folder existence before listing files

Fix #8389
This commit is contained in:
Martino Facchin 2019-01-18 10:12:13 +01:00
parent f15ddeb846
commit e9ecaa70f7

View File

@ -344,6 +344,9 @@ public class FileUtils {
public static List<File> listFiles(File folder, boolean recursive, public static List<File> listFiles(File folder, boolean recursive,
List<String> extensions) { List<String> extensions) {
List<File> result = new ArrayList<>(); List<File> result = new ArrayList<>();
if (!folder.exists()) {
return result;
}
for (File file : folder.listFiles()) { for (File file : folder.listFiles()) {
if (isSCCSOrHiddenFile(file)) if (isSCCSOrHiddenFile(file))