Guard buildSearch() against undefined properties
This is important if custom emojis don’t specify any emoticons, for example.nolan/hinaloe-test
parent
15c7b27ba9
commit
2f7d6eb0d8
|
@ -2,6 +2,10 @@ module.exports = data => {
|
||||||
const search = []
|
const search = []
|
||||||
|
|
||||||
var addToSearch = (strings, split) => {
|
var addToSearch = (strings, split) => {
|
||||||
|
if (!strings) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
(Array.isArray(strings) ? strings : [strings]).forEach((string) => {
|
(Array.isArray(strings) ? strings : [strings]).forEach((string) => {
|
||||||
(split ? string.split(/[-|_|\s]+/) : [string]).forEach((s) => {
|
(split ? string.split(/[-|_|\s]+/) : [string]).forEach((s) => {
|
||||||
s = s.toLowerCase()
|
s = s.toLowerCase()
|
||||||
|
|
Loading…
Reference in New Issue