diff --git a/src/components/EmojiPicker/index.tsx b/src/components/EmojiPicker/index.tsx index ee00bde..3f759c7 100644 --- a/src/components/EmojiPicker/index.tsx +++ b/src/components/EmojiPicker/index.tsx @@ -8,7 +8,12 @@ interface IEmojiPickerProps extends PickerProps { export class EmojiPicker extends Component { retrieveFromLocal() { - return JSON.parse(localStorage.getItem("emojis") as string); + let emojiStorage = localStorage.getItem("emojis"); + if (emojiStorage != null) { + return JSON.parse(emojiStorage as string); + } else { + return undefined; + } } render() {