inputmap.cpp: Avert potential crash when populating DSW menu (nw)

This commit is contained in:
AJR 2017-10-18 20:47:05 -04:00
parent cffa7ecc34
commit aef651f228

View File

@ -553,6 +553,8 @@ void menu_settings::populate(float &customtop, float &custombottom)
for (auto &port : machine().ioport().ports()) for (auto &port : machine().ioport().ports())
for (ioport_field &field : port.second->fields()) for (ioport_field &field : port.second->fields())
if (field.type() == type && field.enabled()) if (field.type() == type && field.enabled())
{
if (!field.settings().empty())
{ {
uint32_t flags = 0; uint32_t flags = 0;
@ -575,6 +577,7 @@ void menu_settings::populate(float &customtop, float &custombottom)
} }
item_append(field.name(), field.setting_name(), flags, (void *)&field); item_append(field.name(), field.setting_name(), flags, (void *)&field);
}
/* for DIP switches, build up the model */ /* for DIP switches, build up the model */
if (type == IPT_DIPSWITCH && !field.diplocations().empty()) if (type == IPT_DIPSWITCH && !field.diplocations().empty())