From 5c2a2255336339993be1f44030378e685e94aecb Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+DoctorMacc@users.noreply.github.com> Date: Sat, 25 Jul 2020 18:21:13 -0400 Subject: [PATCH] Check for null when looking for SRV (#1025) --- .../src/main/java/org/geysermc/connector/GeyserConnector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 527e1248d..669458385 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -149,7 +149,7 @@ public class GeyserConnector { InitialDirContext ctx = new InitialDirContext(); Attribute attr = ctx.getAttributes("dns:///_minecraft._tcp." + remoteAddress, new String[]{"SRV"}).get("SRV"); // size > 0 = SRV entry found - if (attr.size() > 0) { + if (attr != null && attr.size() > 0) { String[] record = ((String) attr.get(0)).split(" "); // Overwrites the existing address and port with that from the SRV record. config.getRemote().setAddress(remoteAddress = record[3]);