diff --git a/src/main/java/com/owncloud/android/providers/UsersAndGroupsSearchProvider.java b/src/main/java/com/owncloud/android/providers/UsersAndGroupsSearchProvider.java index 5f09e1ff0c..a02df6be10 100644 --- a/src/main/java/com/owncloud/android/providers/UsersAndGroupsSearchProvider.java +++ b/src/main/java/com/owncloud/android/providers/UsersAndGroupsSearchProvider.java @@ -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!"); }