Trigger a fatal error when console was asked but the console plugin not found. (#2914)

* Add a message when the console plugin is not found, rather than crash.

In absence of the console plugin, the option entry was not found in m_plugins, making the set_value() crash when deferencing the result of get_entry().

Instead, an error message is logged telling the plugin is not found.

* Trigger a fatal error when console was asked but the console plugin not found.
This commit is contained in:
Sylvain Glaize 2017-12-13 22:24:44 +01:00 committed by Vas Crabb
parent 6fb1268372
commit 8b341d8795

View File

@ -155,7 +155,14 @@ void mame_machine_manager::start_luaengine()
}
if (options().console())
{
m_plugins->set_value("console", "1", OPTION_PRIORITY_CMDLINE);
if (m_plugins->exists(OPTION_CONSOLE))
{
m_plugins->set_value(OPTION_CONSOLE, "1", OPTION_PRIORITY_CMDLINE);
}
else
{
fatalerror("Console plugin not found.\n");
}
}
m_lua->initialize();