fixed add new user bug

fixed add new user bug.
when add new user, just add the key(u.email) to the map(v.cache), the value of map is nil.
pull/1904/head
hex2tan 2019-09-26 13:48:52 +08:00 committed by GitHub
parent e9f53059b1
commit 3d63ec4e78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -47,11 +47,11 @@ func newUserByEmail(config *DefaultConfig) *userByEmail {
func (v *userByEmail) addNoLock(u *protocol.MemoryUser) bool {
email := strings.ToLower(u.Email)
user, found := v.cache[email]
_, found := v.cache[email]
if found {
return false
}
v.cache[email] = user
v.cache[email] = u
return true
}