mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
user search: when reusing temp file, we first need to delete it
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
241ba4104b
commit
42619191d7
1 changed files with 5 additions and 0 deletions
|
@ -406,6 +406,11 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
||||||
// create a file to write bitmap data
|
// create a file to write bitmap data
|
||||||
File f = new File(getContext().getCacheDir(), "test");
|
File f = new File(getContext().getCacheDir(), "test");
|
||||||
try {
|
try {
|
||||||
|
if (f.exists()) {
|
||||||
|
if (!f.delete()) {
|
||||||
|
throw new IllegalStateException("Existing file could not be deleted!");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!f.createNewFile()) {
|
if (!f.createNewFile()) {
|
||||||
throw new IllegalStateException("File could not be created!");
|
throw new IllegalStateException("File could not be created!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue