Check against offline users during permission recalc TAB update (#43)

This commit is contained in:
ironboundred 2023-04-17 10:28:03 -05:00 committed by GitHub
parent 1e3f163f2d
commit 7712eaaf15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,10 @@ public class LuckPermsHook extends Hook {
public void onLuckPermsGroupUpdate(@NotNull UserDataRecalculateEvent event) {
final PlayerTabList tabList = plugin.getTabList();
// Check if the user is online.
if (plugin.getServer().getPlayer(event.getUser().getUniqueId()).isEmpty()) {
return;
}
plugin.getServer().getPlayer(event.getUser().getUniqueId())
.ifPresent(player -> plugin.getServer().getScheduler()
.buildTask(plugin, () -> {