mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
Fix NPE in JavaxResolver
Attributes.get(String) could return 'null'. Take care of that case.
This commit is contained in:
parent
9484fb9259
commit
7d72b9b770
1 changed files with 2 additions and 0 deletions
|
@ -74,6 +74,8 @@ public class JavaxResolver implements DNSResolver {
|
|||
|
||||
Attributes dnsLookup = dirContext.getAttributes(name, new String[] { "SRV" });
|
||||
Attribute srvAttribute = dnsLookup.get("SRV");
|
||||
if (srvAttribute == null)
|
||||
return res;
|
||||
@SuppressWarnings("unchecked")
|
||||
NamingEnumeration<String> srvRecords = (NamingEnumeration<String>) srvAttribute.getAll();
|
||||
while (srvRecords.hasMore()) {
|
||||
|
|
Loading…
Reference in a new issue