Ensure proxiedAddresses is not null before lookup (#4539)

This commit is contained in:
Kas-tle 2024-04-01 15:50:58 -07:00 committed by GitHub
parent fa441f1c7b
commit 08aa5282d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -263,7 +263,10 @@ public final class GeyserServer {
ip = "<IP address withheld>"; ip = "<IP address withheld>";
} }
ConnectionRequestEvent requestEvent = new ConnectionRequestEvent(inetSocketAddress, this.proxiedAddresses.get(inetSocketAddress)); ConnectionRequestEvent requestEvent = new ConnectionRequestEvent(
inetSocketAddress,
this.proxiedAddresses != null ? this.proxiedAddresses.get(inetSocketAddress) : null
);
geyser.eventBus().fire(requestEvent); geyser.eventBus().fire(requestEvent);
if (requestEvent.isCancelled()) { if (requestEvent.isCancelled()) {
geyser.getLogger().debug("Connection request from " + ip + " was cancelled using the API!"); geyser.getLogger().debug("Connection request from " + ip + " was cancelled using the API!");