From 30e3e1fa9b3495faf7facd0e801b6e987d6fa624 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 15 Feb 2016 17:11:22 -0800 Subject: Don't try to run CacheCleaner if no DownloadService (ie: sync) --- app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/src/main') 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(); } -- cgit v1.2.3