Skip to content

Commit a0cbc31

Browse files
committed
Check if DnsCache is null in DnsNameResolver constructor, close AsyncHttpClient#1328
Motivation: We miss checking if DnsCache is null in DnsNameResolver constructor which will later then lead to a NPE. Better fail fast here. Modifications: Check for null and if so throw a NPE. Result: Fail fast.
1 parent 935aa32 commit a0cbc31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netty-bp/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public DnsNameResolver(
196196
this.maxPayloadSize = checkPositive(maxPayloadSize, "maxPayloadSize");
197197
this.optResourceEnabled = optResourceEnabled;
198198
this.hostsFileEntriesResolver = checkNotNull(hostsFileEntriesResolver, "hostsFileEntriesResolver");
199-
this.resolveCache = resolveCache;
199+
this.resolveCache = checkNotNull(resolveCache, "resolveCache");
200200
this.searchDomains = checkNotNull(searchDomains, "searchDomains").clone();
201201
this.ndots = checkPositiveOrZero(ndots, "ndots");
202202

0 commit comments

Comments
 (0)