Do not loop through empty channels on filter

This commit is contained in:
DataHoarder 2023-04-28 21:13:55 +02:00
parent 36dd97927e
commit ce6142df75
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -39,7 +39,7 @@ func filterEntriesForChannel(bot *hbot.Bot, message *hbot.Message, entries []*ch
if e.Channel == message.To {
actualEntry = e
}
if slices.ContainsFunc(exactMatches, func(s string) bool {
if e.ApiEndpoint != "" && e.Name != "" && slices.ContainsFunc(exactMatches, func(s string) bool {
return s == strings.ToLower(e.Name)
}) {
exactMatchesResult = append(exactMatchesResult, e)