Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Only clear cache if there is cache

laurenspriemf03d269a5f6e
diff --git a/mobile/lib/services/memories_cache_service.dart b/mobile/lib/services/memories_cache_service.dart
index a65b7f0ab7..a7a01de641 100644
--- a/mobile/lib/services/memories_cache_service.dart
+++ b/mobile/lib/services/memories_cache_service.dart
@@ -433,7 +433,10 @@ class MemoriesCacheService {
}
Future<void> clearMemoriesCache() async {
- await File(await _getCachePath()).delete();
+ final file = File(await _getCachePath());
+ if (file.existsSync()) {
+ await file.delete();
+ }
_cachedMemories = null;
}
}