Fixed a logical error that can cause a NPE
This commit is contained in:
parent
6f1fd6d26b
commit
48253e8027
|
@ -673,8 +673,7 @@ class AsyncCachingExec extends CachingExecBase implements AsyncExecChainHandler
|
|||
final boolean staleIfErrorEnabled = responseCachingPolicy.isStaleIfErrorEnabled(responseCacheControl, entry);
|
||||
if (cacheRevalidator != null
|
||||
&& !staleResponseNotAllowed(requestCacheControl, responseCacheControl, entry, now)
|
||||
&& validityPolicy.mayReturnStaleWhileRevalidating(responseCacheControl, entry, now)
|
||||
|| staleIfErrorEnabled) {
|
||||
&& (validityPolicy.mayReturnStaleWhileRevalidating(responseCacheControl, entry, now) || staleIfErrorEnabled)) {
|
||||
LOG.debug("Serving stale with asynchronous revalidation");
|
||||
try {
|
||||
final SimpleHttpResponse cacheResponse = generateCachedResponse(responseCacheControl, request, context, entry, now);
|
||||
|
|
|
@ -281,8 +281,7 @@ class CachingExec extends CachingExecBase implements ExecChainHandler {
|
|||
try {
|
||||
if (cacheRevalidator != null
|
||||
&& !staleResponseNotAllowed(requestCacheControl, responseCacheControl, entry, now)
|
||||
&& validityPolicy.mayReturnStaleWhileRevalidating(responseCacheControl, entry, now)
|
||||
|| staleIfErrorEnabled) {
|
||||
&& (validityPolicy.mayReturnStaleWhileRevalidating(responseCacheControl, entry, now) || staleIfErrorEnabled)) {
|
||||
LOG.debug("Serving stale with asynchronous revalidation");
|
||||
final String exchangeId = ExecSupport.getNextExchangeId();
|
||||
context.setExchangeId(exchangeId);
|
||||
|
|
Loading…
Reference in New Issue