Fixed an error in the file format array that caused a crash.
This commit is contained in:
efrick 2021-08-17 13:04:36 -04:00
parent 0bfb18af09
commit 56d884fe39

View File

@ -35,12 +35,11 @@ public class Picture_Lister {
System.exit(0);
}
String picture_dir = args[0];
String[] file_format = {".png"};
String[] file_format = new String[10];
if (args.length > 1){
for(int i = 1; i < args.length; i++){
file_format[i-1] = args[i];
}
}
System.out.println(picture_dir);
//Creating a File object for directory
@ -50,7 +49,7 @@ public class Picture_Lister {
@Override
public boolean accept(File dir, String name) {
if(name.lastIndexOf('.')>0) {
String[] include = file_format;
String[] include = file_format;
// get last index for '.' char
int lastIndex = name.lastIndexOf('.');