From aa3a499c5891d7995b2713651d6adbb7160d7d59 Mon Sep 17 00:00:00 2001 From: Michael Lamers Date: Thu, 7 Nov 2024 16:34:15 +0100 Subject: [PATCH] Check if the "lib" directory exists before iterating its sub-tree (#196) * Check if the "lib" directory exists before iterating its sub-tree * bump flutter version to 3.24.3 --- .fvmrc | 2 +- lib/src/analyze/package_api_analyzer.dart | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.fvmrc b/.fvmrc index 26d017c..c62692b 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,4 +1,4 @@ { - "flutter": "3.22.2", + "flutter": "3.24.3", "flavors": {} } \ No newline at end of file diff --git a/lib/src/analyze/package_api_analyzer.dart b/lib/src/analyze/package_api_analyzer.dart index cfe15bc..230821c 100644 --- a/lib/src/analyze/package_api_analyzer.dart +++ b/lib/src/analyze/package_api_analyzer.dart @@ -384,6 +384,9 @@ class PackageApiAnalyzer { Iterable<_FileToAnalyzeEntry> _findPublicFilesInProject( String normalizedAbsolutePath) { + if (!Directory(normalizedAbsolutePath).existsSync()) { + return []; + } final srcPath = path.join(normalizedAbsolutePath, 'src'); return Directory(normalizedAbsolutePath) // if we want to consider all files that are not in the src folder as potential entry points