From 9a9339fbcb01b47ab28c2ebcc7dba31a3691ad77 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 17 Dec 2020 14:47:45 -0800 Subject: [PATCH] Fix bug in docs.dart (#72544) Add a check that a pubspec file exists before trying to read it. --- dev/tools/dartdoc.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tools/dartdoc.dart b/dev/tools/dartdoc.dart index 510639366a..39a288ec8b 100644 --- a/dev/tools/dartdoc.dart +++ b/dev/tools/dartdoc.dart @@ -468,6 +468,10 @@ List findPackages() { if (entity is! Directory) return false; final File pubspec = File('${entity.path}/pubspec.yaml'); + if (!pubspec.existsSync()) { + print("Unexpected package '${entity.path}' found in packages directory"); + return false; + } // TODO(ianh): Use a real YAML parser here return !pubspec.readAsStringSync().contains('nodoc: true'); })