1
0
Fork 0

Fix crash when menu item has no label

This commit is contained in:
James Turner 2021-02-21 12:12:47 +00:00
parent edf766481d
commit c2c4e6f126

3
src/GUI/FGPUIMenuBar.cxx Normal file → Executable file
View file

@ -162,7 +162,8 @@ FGPUIMenuBar::fireItem (puObject * item)
vector<SGBinding *> &bindings = _bindings[name];
int nBindings = bindings.size();
flightgear::addSentryBreadcrumb("fire menu item:" + string{item->getLabel()}, "info");
const string label = item->getLabel() ? string{ item->getLabel() } : "<unknown>";
flightgear::addSentryBreadcrumb("fire menu item:" + label, "info");
for (int i = 0; i < nBindings; i++)
bindings[i]->fire();