diff --git a/simulation_structs.hpp b/simulation_structs.hpp index 7f4b908..f1e267e 100755 --- a/simulation_structs.hpp +++ b/simulation_structs.hpp @@ -803,7 +803,10 @@ private: std::ifstream ifs(jsonFilepath); nlohmann::json json; ifs >> json; - internalPotentialEnergy = json.at(GET_VARIABLE_NAME(internalPotentialEnergy)); + if (json.contains(GET_VARIABLE_NAME(internalPotentialEnergy))) { + internalPotentialEnergy = json.at(GET_VARIABLE_NAME(internalPotentialEnergy)); + } + return true; } };