mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
Improve error handling in GenerateIdForNewUser()
This commit is contained in:
@ -1021,7 +1021,10 @@ func GenerateIdForNewUser(application *Application) (string, error) {
|
||||
|
||||
lastUserId := -1
|
||||
if lastUser != nil {
|
||||
lastUserId = util.ParseInt(lastUser.Id)
|
||||
lastUserId, err = util.ParseIntWithError(lastUser.Id)
|
||||
if err != nil {
|
||||
return util.GenerateId(), nil
|
||||
}
|
||||
}
|
||||
|
||||
res := strconv.Itoa(lastUserId + 1)
|
||||
|
Reference in New Issue
Block a user