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

Error thrown on null children #36

Closed
pierre-elie opened this issue Nov 5, 2018 · 1 comment
Closed

Error thrown on null children #36

pierre-elie opened this issue Nov 5, 2018 · 1 comment

Comments

@pierre-elie
Copy link

pierre-elie commented Nov 5, 2018

Consider the following where subtitle can be null/undefined, in which case we do not add a <Text> element for it:

<Hyperlink>
  <Text>{title}</Text>
  {subtitle && <Text>{subtitle}</Text>}
</Hyperlink>

This causes Hyperlink to throw en error Cannot read property 'type' of null.

I think this comes from the method parsing children, there is no safe-guard against null/undefined:

let { type : { displayName } = {} } = child

obipawan pushed a commit that referenced this issue Aug 25, 2019
@obipawan
Copy link
Owner

Thanks for reporting @pierre-elie.
This took a lot of time for my attention, but I've been able to get the fix out in v0.0.16

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

No branches or pull requests

2 participants