Skip to content

Commit 9bb5457

Browse files
author
christoph
committed
fixed issue: no optimpref file existing
1 parent 176ce0b commit 9bb5457

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

TimeNETOptimizationEnvironment/src/toe/optimization/OptimizerPreferences.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,19 +1345,21 @@ 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
}
13561358
return numberOfFoundOptiPrefs;
13571359
}
13581360

13591361
/**
1360-
* Updates the label to shwo how many Optipreferences are stored in
1362+
* Updates the label to show how many Optipreferences are stored in
13611363
* pref-folder
13621364
*/
13631365
private void updateNumberOfOptiPrefs() {

0 commit comments

Comments
 (0)