diff --git a/controllers/account.go b/controllers/account.go index 17f83bb6..a7710b9a 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -145,7 +145,12 @@ func (c *ApiController) Signup() { id := util.GenerateId() if application.GetSignupItemRule("ID") == "Incremental" { lastUser := object.GetLastUser(form.Organization) - lastIdInt := util.ParseInt(lastUser.Id) + + lastIdInt := -1 + if lastUser != nil { + lastIdInt = util.ParseInt(lastUser.Id) + } + id = strconv.Itoa(lastIdInt + 1) }