dont translate non strings

This commit is contained in:
barisusakli
2016-09-17 14:20:17 +03:00
parent d7c559a209
commit e69ff93a49

View File

@@ -291,6 +291,10 @@
lang = null;
}
if (!(typeof text === 'string' || text instanceof String) || text === '') {
return cb('');
}
Translator.create(lang).translate(text).then(function (output) {
return cb(output);
}).catch(function (err) {