Merge pull request #7993 from nextcloud/noAvatars

user search: when reusing temp file, we first need to delete it
This commit is contained in:
Andy Scherzinger 2021-02-23 23:48:42 +01:00 committed by GitHub
commit ce4a8159b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -406,6 +406,11 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
// create a file to write bitmap data
File f = new File(getContext().getCacheDir(), "test");
try {
if (f.exists()) {
if (!f.delete()) {
throw new IllegalStateException("Existing file could not be deleted!");
}
}
if (!f.createNewFile()) {
throw new IllegalStateException("File could not be created!");
}