diff --git a/src/github.com/matrix-org/dendrite/cmd/create-account/main.go b/src/github.com/matrix-org/dendrite/cmd/create-account/main.go index 7914a6266..99e9b545d 100644 --- a/src/github.com/matrix-org/dendrite/cmd/create-account/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/create-account/main.go @@ -69,10 +69,13 @@ func main() { os.Exit(1) } - _, err = accountDB.CreateAccount(context.Background(), *username, *password) + account, err := accountDB.CreateAccount(context.Background(), *username, *password) if err != nil { fmt.Println(err.Error()) os.Exit(1) + } else if account == nil { + fmt.Println("Username already exists") + os.Exit(1) } deviceDB, err := devices.NewDatabase(*database, serverName)