Commit 0c22810a by Oliver Woodman

Merge pull request #8459 from WonderzGmbH:fix/8253-cache-exception

PiperOrigin-RevId: 352450607
parents 98182655 c1501a3c
......@@ -837,7 +837,8 @@ public final class SimpleCache implements Cache {
}
private static void createCacheDirectories(File cacheDir) throws CacheException {
if (!cacheDir.mkdirs()) {
// If mkdirs() returns false, double check that the directory doesn't exist before throwing.
if (!cacheDir.mkdirs() && !cacheDir.isDirectory()) {
String message = "Failed to create cache directory: " + cacheDir;
Log.e(TAG, message);
throw new CacheException(message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment