Browse Source

added error handling

pull/34/head
David Haukeness 5 years ago
parent
commit
0ba2507891
No known key found for this signature in database
GPG Key ID: A7F1091956853EF9
  1. 6
      emojiMap.go

6
emojiMap.go

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package main
import (
"fmt"
"regexp"
"strconv"
"strings"
@ -23,7 +22,10 @@ func emojiUnicodeConvert(s string) string { @@ -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
}
}
}

Loading…
Cancel
Save