Skip to content
Snippets Groups Projects
Commit 222a3be5 authored by brinn's avatar brinn
Browse files

Fix bug: remove outdated email key from map when calling addOrUpdateUser() with new email address.

SVN: 28147
parent 37cfe0f5
No related branches found
No related tags found
No related merge requests found
...@@ -160,7 +160,11 @@ final class LineBasedUserStore<T extends UserEntry> implements IUserStore<T> ...@@ -160,7 +160,11 @@ final class LineBasedUserStore<T extends UserEntry> implements IUserStore<T>
assert user != null; assert user != null;
updateMaps(); updateMaps();
idToEntryMap.put(user.getUserId(), user); final T oldUserOrNull = idToEntryMap.put(user.getUserId(), user);
if (oldUserOrNull != null && StringUtils.isNotBlank(oldUserOrNull.getEmail()))
{
emailToEntryMap.remove(oldUserOrNull.getEmail().toLowerCase());
}
if (StringUtils.isNotBlank(user.getEmail())) if (StringUtils.isNotBlank(user.getEmail()))
{ {
if (emailToEntryMap.put(user.getEmail().toLowerCase(), user) != null) if (emailToEntryMap.put(user.getEmail().toLowerCase(), user) != null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment