web: Components: Fixed property validation for drop-down items at ContextMenuButton component

This commit is contained in:
Ilya Oleshko 2019-11-06 10:02:04 +03:00
parent b07a6eb570
commit 63299b2430

View File

@ -116,7 +116,7 @@ class ContextMenuButton extends React.Component {
<DropDown directionX={directionX} isOpen={isOpen}>
{
this.state.data.map((item, index) =>
(item.label || item.icon) && <DropDownItem {...item} key={item.key || index} onClick={this.onDropDownItemClick.bind(this, item)}
(item && (item.label || item.icon)) && <DropDownItem {...item} key={item.key || index} onClick={this.onDropDownItemClick.bind(this, item)}
/>
)
}