Do not crash when pressing download while service is already partially destroyed
This commit is contained in:
parent
e385d4c021
commit
b751ad2aa4
|
@ -512,6 +512,9 @@ public class DownloadService extends Service {
|
||||||
if (isDownloadingFile(request.getSource())) {
|
if (isDownloadingFile(request.getSource())) {
|
||||||
Log.d(TAG, "Skipped enqueueing request. Already running.");
|
Log.d(TAG, "Skipped enqueueing request. Already running.");
|
||||||
return;
|
return;
|
||||||
|
} else if (downloadHandleExecutor.isShutdown()) {
|
||||||
|
Log.d(TAG, "Skipped enqueueing request. Service is already shutting down.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Add new request: " + request.getSource());
|
Log.d(TAG, "Add new request: " + request.getSource());
|
||||||
if (request.getSource().startsWith(Feed.PREFIX_LOCAL_FOLDER)) {
|
if (request.getSource().startsWith(Feed.PREFIX_LOCAL_FOLDER)) {
|
||||||
|
|
Loading…
Reference in New Issue