diff --git a/HubConnection.go b/HubConnection.go index dec9ab0..7cda506 100644 --- a/HubConnection.go +++ b/HubConnection.go @@ -167,7 +167,14 @@ func (this *HubConnection) processProtocolMessage(message string) { this.processEvent(HubEvent{EventType: EVENT_SYSTEM_MESSAGE_FROM_CONN, Message: "Incorrect password."}) case "$GetPass": - this.SayRaw("$MyPass " + Escape(this.Hco.NickPassword) + "|") + if len(this.Hco.NickPassword) == 0 { + // We've got a problem. MyPass with no arguments is a syntax error with no message = instant close + // Just drop the connection + this.processEvent(HubEvent{EventType: EVENT_SYSTEM_MESSAGE_FROM_CONN, Message: "This account is passworded."}) + this.Disconnect() + } else { + this.SayRaw("$MyPass " + Escape(this.Hco.NickPassword) + "|") + } case "$Quit": func() {