Skip to content

Conversation

muli
Copy link

@muli muli commented Mar 10, 2025

Description of the Changes

Issue:
https://kaltura.atlassian.net/browse/FEC-14416

Fix:
Make sure that the portal element is not null or undefined before accessing its childElementCount property.

Resolves FEC-14416

@muli
Copy link
Author

muli commented Mar 10, 2025

@SivanA-Kaltura, can you please take a look? I'm unable to add reviewers because I only have read only access.

@muli muli requested a review from MosheMaorKaltura March 18, 2025 12:43
@muli
Copy link
Author

muli commented Mar 26, 2025

@MosheMaorKaltura, I don't have write permissions, so I can't merge, can you please do that?

@@ -85,7 +85,7 @@ class Overlay extends Component<OverlayProps, any> {
} else {
// Remove the overlay-active class only when overlay portal has a single child
const overlayPortalEl = getOverlayPortalElement(this.props.player);
if (overlayPortalEl!.childElementCount <= 1) {
if (overlayPortalEl && overlayPortalEl.childElementCount <= 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

with TS you can use ?
overlayPortalEl?.childElementCount <= 1

Copy link
Author

@muli muli Apr 7, 2025

Choose a reason for hiding this comment

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

No, because if either overlayPortalEl or childElementCount are undefined, then the expression will be resolved as undefined <= 1, which isn't allowed in TypeScript.

@muli muli closed this by deleting the head repository Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants