diff --git a/lib/utils/delete_file_util.dart b/lib/utils/delete_file_util.dart index 55003d8d4..98ebf16e6 100644 --- a/lib/utils/delete_file_util.dart +++ b/lib/utils/delete_file_util.dart @@ -96,8 +96,12 @@ Future deleteFilesOnDeviceOnly( localIDs.add(file.localID); } } - final deletedIDs = - (await PhotoManager.editor.deleteWithIds(localIDs)).toSet(); + var deletedIDs; + try { + deletedIDs = (await PhotoManager.editor.deleteWithIds(localIDs)).toSet(); + } catch (e, s) { + _logger.severe("Could not delete file", e, s); + } final List deletedFiles = []; for (final file in files) { // Remove only those files that have been removed from disk