From 0ba2507891f7e928c404519c6a1d93a45f08e9c0 Mon Sep 17 00:00:00 2001 From: David Haukeness Date: Sun, 20 Oct 2019 14:35:43 -0600 Subject: [PATCH] added error handling --- emojiMap.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emojiMap.go b/emojiMap.go index dfc2944..fb706d6 100644 --- a/emojiMap.go +++ b/emojiMap.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "regexp" "strconv" "strings" @@ -23,7 +22,10 @@ func emojiUnicodeConvert(s string) string { if matched := reeMatch.MatchString(word); matched { // renders a unicode emoji instead of the name if temp, ok := emojiMap[word]; ok { - pStr[i] = renderUnicodeEmoji(temp) + emj, err := renderUnicodeEmoji(temp) + if err == nil { + pStr[i] = emj + } // else don't do anything to the string } } }