Merged in bugfix/read_property_find_of_undefined (pull request #243)

bugfix/read_property_find_of_undefined
This commit is contained in:
Rene Pfeuffer
2019-04-24 15:00:15 +00:00

View File

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