HADOOP-15764. Addendum patch: Fix NPE in SecurityUtil.
This commit is contained in:
parent
2a5d4315bf
commit
5c8d90763c
|
@ -586,12 +586,14 @@ public final class SecurityUtil {
|
|||
* hadoop.security.token.service.use_ip=false
|
||||
*/
|
||||
protected static class QualifiedHostResolver implements HostResolver {
|
||||
private List<String> searchDomains;
|
||||
private List<String> searchDomains = new ArrayList<>();
|
||||
{
|
||||
ResolverConfig resolverConfig = ResolverConfig.getCurrentConfig();
|
||||
searchDomains = new ArrayList<>();
|
||||
for (Name name : resolverConfig.searchPath()) {
|
||||
searchDomains.add(name.toString());
|
||||
Name[] names = resolverConfig.searchPath();
|
||||
if (names != null) {
|
||||
for (Name name : names) {
|
||||
searchDomains.add(name.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue