aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-02-15 17:11:22 -0800
committerScott Jackson <daneren2005@gmail.com>2016-02-15 17:11:22 -0800
commit30e3e1fa9b3495faf7facd0e801b6e987d6fa624 (patch)
tree2f30a097be834e14dd82aa2371883da120db2908 /app/src/main
parent2a271233030b548457ad9873336432a1e8ff4976 (diff)
downloaddsub-30e3e1fa9b3495faf7facd0e801b6e987d6fa624.tar.gz
dsub-30e3e1fa9b3495faf7facd0e801b6e987d6fa624.tar.bz2
dsub-30e3e1fa9b3495faf7facd0e801b6e987d6fa624.zip
Don't try to run CacheCleaner if no DownloadService (ie: sync)
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();
}