diff --git a/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java b/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java index 7f993781..a67a19d0 100644 --- a/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java +++ b/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java @@ -106,7 +106,7 @@ public class TcpClientSession extends TcpSession { try { Record[] records = new Lookup(getPacketProtocol().getSRVRecordPrefix() + "._tcp." + host, Type.SRV).run(); - if(records.length > 0) { + if(records != null && records.length > 0) { SRVRecord srv = (SRVRecord) records[0]; host = srv.getTarget().toString().replaceFirst("\\.$", "");