mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-24 13:02:06 +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" });
|
Attributes dnsLookup = dirContext.getAttributes(name, new String[] { "SRV" });
|
||||||
Attribute srvAttribute = dnsLookup.get("SRV");
|
Attribute srvAttribute = dnsLookup.get("SRV");
|
||||||
|
if (srvAttribute == null)
|
||||||
|
return res;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
NamingEnumeration<String> srvRecords = (NamingEnumeration<String>) srvAttribute.getAll();
|
NamingEnumeration<String> srvRecords = (NamingEnumeration<String>) srvAttribute.getAll();
|
||||||
while (srvRecords.hasMore()) {
|
while (srvRecords.hasMore()) {
|
||||||
|
|
Loading…
Reference in a new issue