Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(expandable section): Fix uncaught exception #10659

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

tlabaj
Copy link
Contributor

@tlabaj tlabaj commented Jun 25, 2024

What: Closes #10410

@tlabaj tlabaj requested review from a team, wise-king-sullyman and kmcfaul and removed request for a team June 25, 2024 20:48
@patternfly-build
Copy link
Contributor

patternfly-build commented Jun 25, 2024

@dlabaj dlabaj merged commit 5925ef1 into patternfly:main Jul 8, 2024
13 checks passed
Comment on lines +174 to +175
if (this.expandableContentRef) {
const { offsetWidth } = this.expandableContentRef.current;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this fix work?
this.expandableContentRef is assigned as a class property:
expandableContentRef = React.createRef<HTMLDivElement>();
Therefore this.expandableContentRef is always an object. However expandableContentRef.current may be null.

Therefore shouldn't the fix be:

if (this.expandableContentRef.current) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. when i originally pushed a change i had a check to current that is missing here. I will push nother fix so it is included in our up coming release.

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.

Bug - ExpandableSection - Uncaught exception on unmount
6 participants