Skip to content

Commit

Permalink
Fixing java.util.concurrent.RejectedExecutionException
Browse files Browse the repository at this point in the history
Fixing a crash when a download task is rejected from the tread pool.
  • Loading branch information
dglinenko committed Jan 17, 2014
1 parent a38a4e7 commit df0e463
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,15 @@ protected void onPostExecute(final Void result) {

for (UrlDownloader downloader: mDownloaders) {
if (downloader.canDownloadUrl(url)) {
downloader.download(context, url, filename, loader, completion);
try {
downloader.download(context, url, filename, loader, completion);
} catch (Exception e) {
clog("Can't download from url: " + url + " Exception: " + e.getMessage());
mPendingDownloads.remove(url);
if (imageView != null) {
mPendingViews.remove(imageView);
}
}
return;
}
}
Expand Down

0 comments on commit df0e463

Please sign in to comment.