Return empty string from LastParam() if theres no params
This commit is contained in:
parent
a4ebd8d4c4
commit
4a74463ae8
2 changed files with 5 additions and 1 deletions
|
@ -12,7 +12,10 @@ type Message struct {
|
|||
}
|
||||
|
||||
func (m *Message) LastParam() string {
|
||||
return m.Params[len(m.Params)-1]
|
||||
if len(m.Params) > 0 {
|
||||
return m.Params[len(m.Params)-1]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func parseMessage(line string) *Message {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue