Skip to content

Commit

Permalink
Fixed: PathNotFoundException when deleting a file that is already del…
Browse files Browse the repository at this point in the history
…eted
  • Loading branch information
MattyBoy4444 authored and martijn00 committed Jul 31, 2024
1 parent 08e671d commit 91ca805
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 91ca805

Please sign in to comment.