fix: crash when concurrency is negative.

This commit is contained in:
huanghongxun 2021-09-19 10:42:55 +08:00
parent 1b539ade9d
commit 543238be4b

View File

@ -297,6 +297,7 @@ public abstract class FetchTask<T> extends Task<T> {
}
public static void setDownloadExecutorConcurrency(int concurrency) {
concurrency = Math.max(concurrency, 1);
synchronized (Schedulers.class) {
downloadExecutorConcurrency = concurrency;
if (DOWNLOAD_EXECUTOR != null) {