mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-04 03:42:40 +02:00
should resolve #46
This commit is contained in:
parent
19466b5625
commit
362cf6c254
8 changed files with 39 additions and 24 deletions
|
@ -265,18 +265,18 @@ func (h *MessageHandler) adminBan(id string, session types.Session, payload *mes
|
|||
}
|
||||
|
||||
remote := target.Address()
|
||||
if remote == nil {
|
||||
if remote == "" {
|
||||
h.logger.Debug().Msg("no remote address, baling")
|
||||
return nil
|
||||
}
|
||||
|
||||
address := strings.SplitN(*remote, ":", -1)
|
||||
address := strings.SplitN(remote, ":", -1)
|
||||
if len(address[0]) < 1 {
|
||||
h.logger.Debug().Str("address", *remote).Msg("no remote address, baling")
|
||||
h.logger.Debug().Str("address", remote).Msg("no remote address, baling")
|
||||
return nil
|
||||
}
|
||||
|
||||
h.logger.Debug().Str("address", *remote).Msg("adding address to banned")
|
||||
h.logger.Debug().Str("address", remote).Msg("adding address to banned")
|
||||
|
||||
h.banned[address[0]] = true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue