Skip to content
Snippets Groups Projects
Verified Commit 4b8290fa authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Do not crash when unknown symbol is passed to “irf_shocks” option

Closes: #57
parent b1df9ecc
Branches
Tags
No related merge requests found
......@@ -1414,9 +1414,13 @@ ParsingDriver::option_symbol_list(string name_option)
{
vector<string> shocks = symbol_list.get_symbols();
for (auto &shock : shocks)
{
if (!mod_file->symbol_table.exists(shock))
error("Unknown symbol: " + shock);
if (mod_file->symbol_table.getType(shock) != SymbolType::exogenous)
error("Variables passed to irf_shocks must be exogenous. Caused by: " + shock);
}
}
if (name_option.compare("ms.parameters") == 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment