use cacheDir if externalCacheDir is not available

This commit is contained in:
B. Petersen
2019-05-11 18:02:35 +02:00
parent 7c8ef69467
commit 588f8a41fd
@@ -201,8 +201,13 @@ public class PersistentBlobProvider {
}
private static @NonNull File getExternalDir(Context context) throws IOException {
final File externalDir = context.getExternalCacheDir();
if (externalDir == null) throw new IOException("no external files directory");
File externalDir = context.getExternalCacheDir();
if (externalDir==null) {
externalDir = context.getCacheDir();
}
if (externalDir == null) {
throw new IOException("no external files directory");
}
return externalDir;
}