Skip to content
Snippets Groups Projects
Verified Commit 033e6efa 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
(cherry picked from commit 4b8290fa)
parent bd64c91c
No related branches found
No related tags found
No related merge requests found
Pipeline #4402 passed
...@@ -1413,9 +1413,13 @@ ParsingDriver::option_symbol_list(string name_option) ...@@ -1413,9 +1413,13 @@ ParsingDriver::option_symbol_list(string name_option)
{ {
vector<string> shocks = symbol_list.get_symbols(); vector<string> shocks = symbol_list.get_symbols();
for (auto &shock : shocks) for (auto &shock : shocks)
{
if (!mod_file->symbol_table.exists(shock))
error("Unknown symbol: " + shock);
if (mod_file->symbol_table.getType(shock) != SymbolType::exogenous) if (mod_file->symbol_table.getType(shock) != SymbolType::exogenous)
error("Variables passed to irf_shocks must be exogenous. Caused by: " + shock); error("Variables passed to irf_shocks must be exogenous. Caused by: " + shock);
} }
}
if (name_option.compare("ms.parameters") == 0) 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