From 9f0c3cdc0e2586b5290a8280c1920abbbd5c1530 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 4 Nov 2021 20:10:56 -0400 Subject: [PATCH] fix error message for NS SET EMAIL without the password --- irc/nickserv.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/irc/nickserv.go b/irc/nickserv.go index 8166fee8..89e74e02 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -1130,8 +1130,12 @@ func nsConfirmPassword(server *Server, account, passphrase string) (errorMessage errorMessage = `You're not logged into an account` } else { hash := accountData.Credentials.PassphraseHash - if hash != nil && passwd.CompareHashAndPassword(hash, []byte(passphrase)) != nil { - errorMessage = `Password incorrect` + if hash != nil { + if passphrase == "" { + errorMessage = `You must supply a password` + } else if passwd.CompareHashAndPassword(hash, []byte(passphrase)) != nil { + errorMessage = `Password incorrect` + } } } return