Fix panic on empty params

This commit is contained in:
Wim 2017-10-26 22:07:57 +02:00
parent 307ff77b42
commit 4fc48b5aa4
1 changed files with 4 additions and 0 deletions

View File

@ -234,6 +234,10 @@ func (b *Birc) handleNewConnection(client *girc.Client, event girc.Event) {
} }
func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) { func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) {
if len(event.Params) == 0 {
flog.Debugf("handleJoinPart: empty Params? %#v", event)
return
}
channel := event.Params[0] channel := event.Params[0]
if event.Command == "KICK" { if event.Command == "KICK" {
flog.Infof("Got kicked from %s by %s", channel, event.Source.Name) flog.Infof("Got kicked from %s by %s", channel, event.Source.Name)