From 1bcb5a2d1aeb2d9dfc1b4cbee146ffb9b03946d8 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 24 Jan 2017 20:13:40 +0100 Subject: [PATCH] Also check that srvRecords is not empty --- .../src/main/java/org/jivesoftware/smack/util/DNSUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java b/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java index 2d00562b6..60cfd8af3 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java @@ -185,7 +185,7 @@ public class DNSUtil { } List srvRecords = dnsResolver.lookupSRVRecords(srvDomain, failedAddresses, dnssecMode); - if (srvRecords != null) { + if (srvRecords != null && !srvRecords.isEmpty()) { if (LOGGER.isLoggable(Level.FINE)) { String logMessage = "Resolved SRV RR for " + srvDomain + ":"; for (SRVRecord r : srvRecords)