From 0d18995c3d00f0d6fd3da0e0e435fb92455c8811 Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Thu, 9 Nov 2017 17:04:13 -0800 Subject: [PATCH] Handle invalid emoji name in `Emoji` component [Fix #143] --- src/components/emoji.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/emoji.js b/src/components/emoji.js index 7c823cf..d15a0ba 100644 --- a/src/components/emoji.js +++ b/src/components/emoji.js @@ -60,7 +60,10 @@ const Emoji = props => { } } - var { unified, custom, short_names, imageUrl } = _getData(props), + let data = _getData(props) + if (!data) { return null } + + let { unified, custom, short_names, imageUrl } = data, style = {}, children = props.children, className = 'emoji-mart-emoji',