We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaaf092 commit 4ba567dCopy full SHA for 4ba567d
src/main/java/me/creepermaxcz/mcbots/Main.java
@@ -92,10 +92,12 @@ public static void main(String[] args) throws Exception {
92
port = Integer.parseInt(split[1]);
93
} else {
94
Record[] records = new Lookup("_minecraft._tcp." + address, Type.SRV).run();
95
- for (Record record : records) {
96
- SRVRecord srv = (SRVRecord) record;
97
- address = srv.getTarget().toString().replaceFirst("\\.$", "");
98
- port = srv.getPort();
+ if (records != null) {
+ for (Record record : records) {
+ SRVRecord srv = (SRVRecord) record;
+ address = srv.getTarget().toString().replaceFirst("\\.$", "");
99
+ port = srv.getPort();
100
+ }
101
}
102
103
0 commit comments