Skip to content

Commit fd7e55d

Browse files
authored
Merge pull request #32 from cribspot/master
Fix crash if emojify string is null
2 parents 6f52401 + 49f140c commit fd7e55d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/emoji.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Emoji.which = function which(emoji_code) {
8080
* @return {string}
8181
*/
8282
Emoji.emojify = function emojify(str, on_missing) {
83+
if (!str) return '';
84+
8385
return str.split(parser) // parse emoji via regex
8486
.map(function parseEmoji(s, i) {
8587
// every second element is an emoji, e.g. "test :fast_forward:" -> [ "test ", "fast_forward" ]

0 commit comments

Comments
 (0)