use len() to check if a slice is empty
This commit is contained in:
parent
496ff5c9d2
commit
5511aaca5e
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue