diff --git a/lib/features/home/presentation/bloc/home_bloc.dart b/lib/features/home/presentation/bloc/home_bloc.dart index 2132279..6ed2b60 100644 --- a/lib/features/home/presentation/bloc/home_bloc.dart +++ b/lib/features/home/presentation/bloc/home_bloc.dart @@ -92,8 +92,9 @@ class HomeBloc extends Bloc { Future preCacheQuestionGifs() async { try { final Directory directory = Directory( - '${StoragePath.documentDir}/question_image', + '${StoragePath.documentDir.path}/question_image', ); + if (!directory.existsSync()) return; final List files = directory.listSync(); await Future.wait( files.map( @@ -110,8 +111,9 @@ class HomeBloc extends Bloc { Future preCacheAnswerGifs() async { try { final Directory directory = Directory( - '${StoragePath.documentDir}/answer_image', + '${StoragePath.documentDir.path}/answer_image', ); + if (!directory.existsSync()) return; final List files = directory.listSync(); await Future.wait( files.map(