diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index 198c03999..628ff2112 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -51,6 +51,7 @@ Licensed to the Apache Software Foundation (ASF) under one import org.json.JSONArray; import org.json.JSONException; +import java.lang.SecurityException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; @@ -1239,7 +1240,11 @@ private void checkForDuplicateImage(int type) { id--; } Uri uri = Uri.parse(contentStore + "/" + id); - this.cordova.getActivity().getContentResolver().delete(uri, null, null); + try { + this.cordova.getActivity().getContentResolver().delete(uri, null, null); + } catch (SecurityException e) { + LOG.d(LOG_TAG, "Swallowed error, probably caused by missing permissions, while trying to delete duplicate image."); + } cursor.close(); } }