From d39364376a4bd12d5916fec8d8700f70c622b11c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Jul 2025 10:34:41 -0700 Subject: [PATCH] Catch delete errors --- lib/geolocation_service.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/geolocation_service.dart b/lib/geolocation_service.dart index 68fa110..955dd13 100644 --- a/lib/geolocation_service.dart +++ b/lib/geolocation_service.dart @@ -46,7 +46,11 @@ class GeolocationService { static Future onLocation(bg.Location location) async { if (_shouldDelete(location)) { - await bg.BackgroundGeolocation.destroyLocation(location.uuid); + try { + await bg.BackgroundGeolocation.destroyLocation(location.uuid); + } catch(error) { + developer.log('Failed to delete location', error: error); + } } else { LocationCache.set(location); try {