check that emojione is defined before usage

This commit is contained in:
Tor Hveem 2015-03-23 15:07:51 +01:00
parent 32a998c949
commit 36ae273460
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ weechat.filter('getBufferQuickKeys', function () {
// Emojifis the string using https://github.com/Ranks/emojione // Emojifis the string using https://github.com/Ranks/emojione
weechat.filter('emojify', function() { weechat.filter('emojify', function() {
return function(text, enable_JS_Emoji) { return function(text, enable_JS_Emoji) {
if (enable_JS_Emoji === true) { if (enable_JS_Emoji === true && window.emojione !== undefined) {
return emojione.unicodeToImage(text); return emojione.unicodeToImage(text);
} else { } else {
return(text); return(text);