Skip to content

Commit 2130b34

Browse files
committed
Handle exist sync
1 parent 23d936a commit 2130b34

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

flutter_cache_manager/lib/src/cache_store.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:async';
22
import 'dart:io';
33

4+
import 'package:flutter/foundation.dart';
45
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
56

67
import 'storage/file_system/file_system.dart';
@@ -187,7 +188,7 @@ class CacheStore {
187188
}
188189
final file = await fileSystem.createFile(cacheObject.relativePath);
189190

190-
if (file.existsSync()) {
191+
if (kIsWeb ? await file.exists() : file.existsSync()) {
191192
try {
192193
await file.delete();
193194
// ignore: unused_catch_clause

0 commit comments

Comments
 (0)