aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java
index 7044410b..21fe3fd5 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java
@@ -529,8 +529,9 @@ public class DownloadFile implements BufferFile {
}
// Only run these if not interrupted, ie: cancelled
- if(!isCancelled()) {
- new CacheCleaner(context, DownloadService.getInstance()).cleanSpace();
+ DownloadService downloadService = DownloadService.getInstance();
+ if(downloadService != null && !isCancelled()) {
+ new CacheCleaner(context, downloadService).cleanSpace();
checkDownloads();
}