From e69fd9dea4b9c6c0127c99bc3aa3d211295253a6 Mon Sep 17 00:00:00 2001 From: devmil Date: Sat, 26 Oct 2024 17:10:47 +0200 Subject: [PATCH] Check if the "lib" directory exists before iterating its sub-tree --- lib/src/analyze/package_api_analyzer.dart | 3 +++ 1 file changed, 3 insertions(+) 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