DiskLruCache icon indicating copy to clipboard operation
DiskLruCache copied to clipboard

Avoid IOExceptions in delete() when the cache dir is deleted externally.

Open sjudd opened this issue 8 years ago • 0 comments

File#listFiles() will return null if the directory has been deleted. This scenario isn’t totally far fetched because it’s fairly common for Android developers to place their disk caches in the Android application cache directory. The cache directory can be cleared at any time by the system, including while the app is open, which in turn can cause unexpected IOExceptions when delete() is called.

See https://github.com/bumptech/glide/issues/2465 for additional context.

sjudd avatar Nov 27 '17 03:11 sjudd