Null check channel in player join listener

Fixes #3390
This commit is contained in:
Nassim Jahnke 2024-09-03 16:43:55 +02:00
parent 6555bcda74
commit 369b076cad
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -112,7 +112,10 @@ public class JoinListener implements Listener {
return;
}
// The connection has already closed, that was a quick leave
if (!channel.isOpen()) return;
// Channel may be null if a plugin is manually calling the event for a non-player...
if (channel == null || !channel.isOpen()) {
return;
}
UserConnection user = getUserConnection(channel);
if (user == null) {