diff --git a/src/scenario/scenario.cpp b/src/scenario/scenario.cpp index 4f7f02cc..091d68d2 100644 --- a/src/scenario/scenario.cpp +++ b/src/scenario/scenario.cpp @@ -607,6 +607,9 @@ std::string cScenario::get_feature_flag(std::string flag) { } std::string cScenario::get_sdf_name(int row, int col) { + if(row < 0 || row >= SDF_ROWS || col < 0 || col >= SDF_COLUMNS){ + throw "Tried to access SDF name for out-of-bounds flag (" + std::to_string(row) + ", " + std::to_string(col) + ")"; + } if(sdf_names.find(row) == sdf_names.end()) return ""; if(sdf_names[row].find(col) == sdf_names[row].end())