diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/util/FileUtil.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index f72ae66b..87ec571b 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -430,11 +430,13 @@ public class FileUtil { try { File file = new File(context.getCacheDir(), fileName); - Date fileDate = new Date(file.lastModified()); - // Convert into hours - long age = (new Date().getTime() - fileDate.getTime()) / 1000 / 3600; - if(hoursOld != 0 && age > hoursOld) { - return null; + if(hoursOld != 0) { + Date fileDate = new Date(file.lastModified()); + // Convert into hours + long age = (new Date().getTime() - fileDate.getTime()) / 1000 / 3600; + if(age > hoursOld) { + return null; + } } RandomAccessFile randomFile = new RandomAccessFile(file, "r"); |