mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
fixed issue: Cannot read property 'find' of undefined for changesets
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user