fixed issue: Cannot read property 'find' of undefined for changesets

This commit is contained in:
Florian Scholdei
2019-04-24 16:55:24 +02:00
parent d2c2a1b23c
commit 1cd6872afe

View File

@@ -41,10 +41,13 @@ class BranchSelector extends React.Component<Props, State> {
} }
componentDidMount() { componentDidMount() {
const selectedBranch = this.props.branches.find( const { branches } = this.props;
branch => branch.name === this.props.selectedBranch if (branches) {
); const selectedBranch = branches.find(
this.setState({ selectedBranch }); branch => branch.name === this.props.selectedBranch
);
this.setState({ selectedBranch });
}
} }
render() { render() {