Skip to content

Commit

Permalink
Fix when multiple tab list entries were filtered
Browse files Browse the repository at this point in the history
Forgot the null check so we would leak the n-1 entries
  • Loading branch information
aromaa committed Jan 6, 2025
1 parent cd61fe8 commit 341d518
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void sendUpdate(final TabListEntry entry, final EnumSet<ClientboundPlayerInfoUpd
((SpongeTabListEntry) entry).updateWithoutSend();
entry.setListed(update.listed());
}
} else {
} else if (filteredEntries == null) {
if (packet.entries().size() == 1) {
return null;
}
Expand All @@ -263,13 +263,15 @@ void sendUpdate(final TabListEntry entry, final EnumSet<ClientboundPlayerInfoUpd
for (int i = 0; i < packet.profileIds().size(); i++) {
final UUID uniqueId = packet.profileIds().get(i);
final TabListEntry entry = this.entries.remove(uniqueId);
if (entry == null) {
if (entry != null) {
if (filteredProfileIds != null) {
filteredProfileIds.add(uniqueId);
}
} else if (filteredProfileIds == null) {
if (packet.profileIds().size() == 1) {
return null;
}
filteredProfileIds = new ArrayList<>(packet.profileIds().subList(0, i));
} else if (filteredProfileIds != null) {
filteredProfileIds.add(uniqueId);
}
}
if (filteredProfileIds == null) {
Expand Down

0 comments on commit 341d518

Please sign in to comment.