Skip to content

Commit

Permalink
Merge pull request #423 from MattyBoy4444/develop
Browse files Browse the repository at this point in the history
Fixed: PathNotFoundException when deleting a file that is already del…
  • Loading branch information
martijn00 authored Jul 31, 2024
2 parents 479f341 + 91ca805 commit 1757966
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flutter_cache_manager/lib/src/cache_store.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'dart:io' as io;
Expand Down Expand Up @@ -185,7 +186,12 @@ class CacheStore {
final file = io.File(cacheObject.relativePath);

if (file.existsSync()) {
await file.delete();
try {
await file.delete();
// ignore: unused_catch_clause
} on PathNotFoundException catch (e) {
// File has already been deleted. Do nothing #184
}
}
}

Expand Down

0 comments on commit 1757966

Please sign in to comment.