Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjudd
Copy link
Contributor

@sjudd sjudd commented Nov 27, 2017

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 bumptech/glide#2465 for additional
context.

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 bumptech/glide#2465 for additional 
context.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant