3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-01 23:50:11 +02:00

Check for null when looking for SRV (#1025)

Dieser Commit ist enthalten in:
Camotoy 2020-07-25 18:21:13 -04:00 committet von GitHub
Ursprung af484a425b
Commit 5c2a225533
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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]);