diff --git a/modules/PhysiCell_settings.cpp b/modules/PhysiCell_settings.cpp index d57b7e050..5517d8da7 100644 --- a/modules/PhysiCell_settings.cpp +++ b/modules/PhysiCell_settings.cpp @@ -354,6 +354,11 @@ T& Parameters::operator()( int i ) template T& Parameters::operator()( std::string str ) { + if (name_to_index_map.find(str) == name_to_index_map.end()) + { + std::cerr << "ERROR : Unknown parameter " << str << " ! Quitting." << std::endl; + exit(-1); + } return parameters[ name_to_index_map[str] ].value; } @@ -366,6 +371,11 @@ Parameter& Parameters::operator[]( int i ) template Parameter& Parameters::operator[]( std::string str ) { + if (name_to_index_map.find(str) == name_to_index_map.end()) + { + std::cerr << "ERROR : Unknown parameter " << str << " ! Quitting." << std::endl; + exit(-1); + } return parameters[ name_to_index_map[str] ]; }