Skip to content

Commit

Permalink
Merge pull request #75 from williamkhshea/openKeys
Browse files Browse the repository at this point in the history
added guard clause agains undefined selectedKeys and openKeys
  • Loading branch information
afc163 committed Jan 24, 2017
2 parents 3566a6a + 36b0de3 commit 18dc583
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ const Menu = React.createClass({
componentWillReceiveProps(nextProps) {
const props = {};
if ('selectedKeys' in nextProps) {
props.selectedKeys = nextProps.selectedKeys;
props.selectedKeys = nextProps.selectedKeys || [];
}
if ('openKeys' in nextProps) {
props.openKeys = nextProps.openKeys;
props.openKeys = nextProps.openKeys || [];
}
this.setState(props);
},
Expand Down

0 comments on commit 18dc583

Please sign in to comment.