Fix use of invalidated iterator in the command map on exception

The command map can get mutated by command execution, so the iterators
can get invalidated (now that we use our curstom HashMap implementation,
all iterators are potentially invalidated by insert/removal)
This commit is contained in:
Maxime Coste 2017-05-07 16:22:29 +01:00
parent c5824fc506
commit 3a3144f3f5

View File

@ -456,7 +456,7 @@ void CommandManager::execute_single_command(CommandParameters params,
catch (runtime_error& error) catch (runtime_error& error)
{ {
throw runtime_error(format("{}:{}: '{}' {}", pos.line+1, pos.column+1, throw runtime_error(format("{}:{}: '{}' {}", pos.line+1, pos.column+1,
command_it->key, error.what())); params[0], error.what()));
} }
} }