3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 20:09:41 +01:00

accountreg: Fix crash

This commit is contained in:
Daniel Oaks 2017-04-17 21:00:49 +10:00
parent 9a94121281
commit ff3a864aa3

View File

@ -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)