Skip to content

Commit

Permalink
fix: npe in Listener1Assist#connectEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianhua Ran committed Sep 6, 2018
1 parent 141ffcd commit cfe2558
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ public DownloadConnection.Connected interceptConnect(DownloadChain chain) throws

DownloadConnection.Connected connected = chain.processConnect();

if (chain.getCache().isInterrupt()) {
throw InterruptException.SIGNAL;
}

Map<String, List<String>> responseHeaderFields = connected.getResponseHeaderFields();
if (responseHeaderFields == null) responseHeaderFields = new HashMap<>();

OkDownload.with().callbackDispatcher().dispatch().connectEnd(task, blockIndex,
connected.getResponseCode(), responseHeaderFields);
if (chain.getCache().isInterrupt()) {
throw InterruptException.SIGNAL;
}

// if precondition failed.
final DownloadStrategy strategy = OkDownload.with().downloadStrategy();
Expand Down

0 comments on commit cfe2558

Please sign in to comment.