Skip to content

Conversation

YannickRe
Copy link
Contributor

Q A
Bug fix? [X]

What's in this Pull Request?

A fix for two potential null reference issues:

  • when expandToSelected == true but defaultSelectedKeys == null. This combination of properties does not make much sense : if you want expandToSelected you NEED values in defaultSelectedKeys, but defaultSelectedKeys is not required thus this combination can happen and it breaks the control.
  • when expandToSelected == true but somewhere in the tree there is a treeItem.children == null. You should set children == null when you don't want the expand arrow to show, but it breaks in combination with expandToSelection == true.

This PR fixes both issues.

- when expandToSelected == true but nothing has been passed to defaultSelectedKeys (it doesn't make much sense tocombine both properties like this BUT defaultSelectedKeys is not required thus this case should be properly handled)
- when expandToSelected == true but somewhere in the tree, treeItem.children == null (which is normal when there aren't any children of this specific item)
@AJIXuMuK AJIXuMuK merged commit 5735056 into pnp:dev Mar 14, 2021
@AJIXuMuK
Copy link
Collaborator

Thank you @YannickRe for the PR!

It has been merged and will be included in the next release.

@AJIXuMuK AJIXuMuK added this to the 2.6.0 milestone Mar 14, 2021
@estruyf estruyf mentioned this pull request Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants