From ffc31f034c8fdf12532860387a0037a06aad4901 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 18 Dec 2023 09:54:42 -0600 Subject: [PATCH] chore(mobile): handle delete file error (#5827) --- mobile/lib/modules/backup/services/backup.service.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mobile/lib/modules/backup/services/backup.service.dart b/mobile/lib/modules/backup/services/backup.service.dart index 4bc6e19867..99660d6907 100644 --- a/mobile/lib/modules/backup/services/backup.service.dart +++ b/mobile/lib/modules/backup/services/backup.service.dart @@ -394,8 +394,12 @@ class BackupService { continue; } finally { if (Platform.isIOS) { - file?.deleteSync(); - livePhotoFile?.deleteSync(); + try { + await file?.delete(); + await livePhotoFile?.delete(); + } catch (e) { + debugPrint("ERROR deleting file: ${e.toString()}"); + } } } }