Fix switching download source problem

This commit is contained in:
huangyuhui
2016-02-19 10:24:58 +08:00
parent 6aaad71126
commit 115bc85c58
2 changed files with 6 additions and 3 deletions

View File

@@ -121,8 +121,11 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
if (repeat > 0) {
HMCLog.warn("Failed to download, repeat: " + repeat);
if (failedCallbackReturnsNewURL != null) {
url = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
HMCLog.warn("Switch to: " + url);
URL tmp = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
if (tmp != null) {
url = tmp;
HMCLog.warn("Switch to: " + url);
}
}
}
try {