diff options
author | Scott Jackson <daneren2005@gmail.com> | 2016-02-15 17:11:22 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2016-02-15 17:11:22 -0800 |
commit | 30e3e1fa9b3495faf7facd0e801b6e987d6fa624 (patch) | |
tree | 2f30a097be834e14dd82aa2371883da120db2908 /app/src/main | |
parent | 2a271233030b548457ad9873336432a1e8ff4976 (diff) | |
download | dsub-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.java | 5 |
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(); } |