Fix segfault when MenuItem does not have Action

This commit is contained in:
FreeSlave 2016-04-29 08:38:37 -04:00
parent 84895abfb2
commit 07d2b0cf07
1 changed files with 2 additions and 2 deletions

View File

@ -211,7 +211,7 @@ class MenuItem {
}
/// returns item label
@property UIString label() {
return _action.labelValue;
return _action !is null ? _action.labelValue : UIString("");
}
/// returns item action
@property const(Action) action() const { return _action; }
@ -372,7 +372,7 @@ class MenuItemWidget : WidgetGroupDefaultDrawing {
_item = item;
styleId = STYLE_MENU_ITEM;
updateState();
string iconId = _item.action.iconId;
string iconId = _item.action !is null ? _item.action.iconId : "";
if (_item.type == MenuItemType.Check)
iconId = "btn_check";
else if (_item.type == MenuItemType.Radio)