Skip to content

Commit

Permalink
Fixed #2133 - PickList crashes Application when using SourceSelection
Browse files Browse the repository at this point in the history
Fixed npe on item select when using custom Source/TargetSelection
  • Loading branch information
mcandu committed Jun 23, 2021
2 parents 6ceef21 + f23e949 commit 07360c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/picklist/PickList.js
Expand Up @@ -195,10 +195,10 @@ export class PickList extends Component {
this.setState({ [stateKey]: e.value });
}

if (this.state.sourceSelection.length && stateKey === 'targetSelection') {
if (this.state.sourceSelection && this.state.sourceSelection.length && stateKey === 'targetSelection') {
this.setState({ sourceSelection: [] })
}
else if (this.state.targetSelection.length && stateKey === 'sourceSelection') {
else if (this.state.targetSelection && this.state.targetSelection.length && stateKey === 'sourceSelection') {
this.setState({ targetSelection: [] })
}
}
Expand Down

0 comments on commit 07360c7

Please sign in to comment.