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

Check whether node.children is undefined #8

Closed
wants to merge 1 commit into from

Conversation

alexander-turner
Copy link

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests (Note: I don't see where to add a test to make sure this gets caught)

Description of changes

A function wasn't checking that a property was defined before trying to access that property's length field. The function now returns the empty list if the property is undefined.

Signed-off-by: Alex Turner <alex@turntrout.com>
@github-actions github-actions bot added the 👋 phase/new Post is being triaged automatically label Apr 1, 2024

This comment has been minimized.

@wooorm
Copy link
Member

wooorm commented Apr 1, 2024

Hey Alex! The function is only called on nodes with children. You are apparently seeing some issue. There is a root problem somewhere. You can try patching it here, but you’ll run into it everywhere. Better to figure out the root cause. Can you do some debugging and figure out why you have parent nodes without children?

@wooorm
Copy link
Member

wooorm commented Apr 3, 2024

Closing as this is probably a problem in your code somewhere else!

@wooorm wooorm closed this Apr 3, 2024
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label Apr 3, 2024

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 👋 phase/new Post is being triaged automatically labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

Successfully merging this pull request may close these issues.

None yet

2 participants