diff --git a/src/parameters/persistent.cpp b/src/parameters/persistent.cpp
index 483227b..5e4a5fd 100644
--- a/src/parameters/persistent.cpp
+++ b/src/parameters/persistent.cpp
@@ -130,9 +130,6 @@ void save_parameters(const char *filename)
// printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size());
- if (!global_power_valid())
- return;
-
pathname = get_param_directory(filename);
file.open(pathname, ios::out);
@@ -141,12 +138,15 @@ void save_parameters(const char *filename)
return;
}
- map<string, int>::iterator it;
+ if (global_power_valid())
+ {
+ map<string, int>::iterator it;
- for (it = param_index.begin(); it != param_index.end(); it++) {
- int index;
- index = it->second;
- file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
+ for (it = param_index.begin(); it != param_index.end(); it++) {
+ int index;
+ index = it->second;
+ file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
+ }
}
file.close();
}