Skip to content

Commit

Permalink
BugFix EntityListIterator not closed in NotificationMessageImpl#getNo…
Browse files Browse the repository at this point in the history
…tifyUserIds
  • Loading branch information
chunlinyao committed Nov 29, 2023
1 parent d82db61 commit 746d85c
Showing 1 changed file with 10 additions and 6 deletions.
Expand Up @@ -96,12 +96,16 @@ class NotificationMessageImpl implements NotificationMessage, Externalizable {
EntityListIterator eli = ef.find("moqui.security.UserGroupMember")
.conditionDate("fromDate", "thruDate", new Timestamp(System.currentTimeMillis()))
.condition("userGroupId", userGroupId).disableAuthz().iterator()
EntityValue nextValue
while ((nextValue = (EntityValue) eli.next()) != null) {
String userId = (String) nextValue.userId
if (checkedUserIds.contains(userId)) continue
checkedUserIds.add(userId)
if (checkUserNotify(userId, ef)) notifyUserIds.add(userId)
try {
EntityValue nextValue
while ((nextValue = (EntityValue) eli.next()) != null) {
String userId = (String) nextValue.userId
if (checkedUserIds.contains(userId)) continue
checkedUserIds.add(userId)
if (checkUserNotify(userId, ef)) notifyUserIds.add(userId)
}
} finally {
eli.close();
}
}

Expand Down

1 comment on commit 746d85c

@jonesde
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please sign in to comment.