Guard buildSearch() against undefined properties

This is important if custom emojis don’t specify any emoticons, for example.
nolan/hinaloe-test
Jakob Krigovsky 2017-05-26 09:43:11 +02:00
parent 15c7b27ba9
commit 2f7d6eb0d8
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,10 @@ module.exports = data => {
const search = []
var addToSearch = (strings, split) => {
if (!strings) {
return
}
(Array.isArray(strings) ? strings : [strings]).forEach((string) => {
(split ? string.split(/[-|_|\s]+/) : [string]).forEach((s) => {
s = s.toLowerCase()