Avoid NPE when group is missing

Change-Id: If4f1f0ff086132fcad7147b375bc0317a7628790
This commit is contained in:
Shawn O. Pearce
2011-10-10 12:23:32 -07:00
parent cf6c62366f
commit 3ab5d64571

View File

@@ -71,7 +71,8 @@ public abstract class ChangeEmail extends OutgoingEmail {
final IdentifiedUser user = args.identifiedUserFactory.create(id);
final Set<AccountGroup.UUID> gids = user.getEffectiveGroups();
for (final AccountGroup.UUID gid : gids) {
if (args.groupCache.get(gid).isEmailOnlyAuthors()) {
AccountGroup group = args.groupCache.get(gid);
if (group != null && group.isEmailOnlyAuthors()) {
emailOnlyAuthors = true;
break;
}