use len() to check if a slice is empty

This commit is contained in:
Dawid Wysokiński 2021-05-06 17:15:10 +02:00
parent 496ff5c9d2
commit 5511aaca5e
2 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ func (h *handler) deleteClosedTWServers() {
log.Errorln("deleteClosedTWServers: " + err.Error())
return
}
if list == nil || list.Items == nil {
if list == nil || len(list.Items) <= 0 {
return
}

View File

@ -108,7 +108,7 @@ func (s *Session) translateCoords(ctx *commandCtx, m *discordgo.MessageCreate) {
},
},
)
if err != nil || list == nil || list.Items == nil {
if err != nil || list == nil || len(list.Items) <= 0 {
return
}