Skip to content

Commit 3292325

Browse files
fixed issue: no optipref file existing
1 parent 9419c47 commit 3292325

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

TimeNETOptimizationEnvironment/src/toe/optimization/OptimizerPreferences.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,11 +1345,13 @@ public int getNumberOfOptiPrefs() {
13451345

13461346
File[] listOfFiles = folderToScan.listFiles();
13471347

1348-
for (int i = 0; i < listOfFiles.length; i++) {
1349-
if (listOfFiles[i].isFile()) {
1350-
target_file = listOfFiles[i].getName();
1351-
if (target_file.startsWith(standardFile.getName())) {
1352-
numberOfFoundOptiPrefs++;
1348+
if (listOfFiles != null) {
1349+
for (int i = 0; i < listOfFiles.length; i++) {
1350+
if (listOfFiles[i].isFile()) {
1351+
target_file = listOfFiles[i].getName();
1352+
if (target_file.startsWith(standardFile.getName())) {
1353+
numberOfFoundOptiPrefs++;
1354+
}
13531355
}
13541356
}
13551357
}

0 commit comments

Comments
 (0)