From ff3a864aa30c658d67567609ae0e497e20d99b1c Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Mon, 17 Apr 2017 21:00:49 +1000 Subject: [PATCH] accountreg: Fix crash --- irc/accountreg.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/irc/accountreg.go b/irc/accountreg.go index 083f22c7..f17100a3 100644 --- a/irc/accountreg.go +++ b/irc/accountreg.go @@ -84,6 +84,12 @@ func removeFailedRegCreateData(store *buntdb.DB, account string) { // regCreateHandler parses the REG CREATE command. func regCreateHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { + // make sure reg is enabled + if !server.accountRegistration.Enabled { + client.Send(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", "Account registration is disabled") + return false + } + // get and sanitise account name account := strings.TrimSpace(msg.Params[1]) casefoldedAccount, err := CasefoldName(account)