Check if DNS lookup result is null.

This commit is contained in:
Steveice10 2020-04-21 12:08:50 -07:00
parent b98e525016
commit 43b394dfdc

View file

@ -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("\\.$", "");