diff --git a/src/Hyperlink.js b/src/Hyperlink.js index 1d895c0..c391bb0 100644 --- a/src/Hyperlink.js +++ b/src/Hyperlink.js @@ -107,7 +107,10 @@ class Hyperlink extends Component { } parse (component) { - let { props: { children} = {}, type: { displayName } = {} } = component + let { + props: { children } = {}, + type: { displayName } = {}, + } = component || {} if (!children) return component @@ -118,7 +121,7 @@ class Hyperlink extends Component { } return React.cloneElement(component, componentProps, React.Children.map(children, child => { - let { type : { displayName } = {} } = child + let { type : { displayName } = {} } = child || {} if (typeof child === 'string' && this.linkifyIt.pretest(child)) return this.linkify({ child }) if (displayName === 'Text' && !this.isTextNested(child))