forked from GeyserMC/Geyser
Check for null when looking for SRV (#1025)
This commit is contained in:
parent
af484a425b
commit
5c2a225533
1 changed files with 1 additions and 1 deletions
|
@ -149,7 +149,7 @@ public class GeyserConnector {
|
||||||
InitialDirContext ctx = new InitialDirContext();
|
InitialDirContext ctx = new InitialDirContext();
|
||||||
Attribute attr = ctx.getAttributes("dns:///_minecraft._tcp." + remoteAddress, new String[]{"SRV"}).get("SRV");
|
Attribute attr = ctx.getAttributes("dns:///_minecraft._tcp." + remoteAddress, new String[]{"SRV"}).get("SRV");
|
||||||
// size > 0 = SRV entry found
|
// size > 0 = SRV entry found
|
||||||
if (attr.size() > 0) {
|
if (attr != null && attr.size() > 0) {
|
||||||
String[] record = ((String) attr.get(0)).split(" ");
|
String[] record = ((String) attr.get(0)).split(" ");
|
||||||
// Overwrites the existing address and port with that from the SRV record.
|
// Overwrites the existing address and port with that from the SRV record.
|
||||||
config.getRemote().setAddress(remoteAddress = record[3]);
|
config.getRemote().setAddress(remoteAddress = record[3]);
|
||||||
|
|
Loading…
Reference in a new issue