| Index: utils/pub/validator/name.dart
|
| diff --git a/utils/pub/validator/name.dart b/utils/pub/validator/name.dart
|
| index 7c4778c8af4604b849c9b16b4e9a4c6587d4a7c9..b38c645e2ad39153b8581e24629ee9492ad9c2f3 100644
|
| --- a/utils/pub/validator/name.dart
|
| +++ b/utils/pub/validator/name.dart
|
| @@ -10,6 +10,7 @@ import 'dart:io';
|
| import '../../../pkg/path/lib/path.dart' as path;
|
| import '../entrypoint.dart';
|
| import '../io.dart';
|
| +import '../utils.dart';
|
| import '../validator.dart';
|
|
|
| /// Dart reserved words, from the Dart spec.
|
| @@ -47,8 +48,9 @@ class NameValidator extends Validator {
|
| /// to the package's root directory.
|
| Future<List<String>> get _libraries {
|
| var libDir = join(entrypoint.root.dir, "lib");
|
| - return dirExists(libDir).then((libDirExists) {
|
| - if (!libDirExists) return [];
|
| + // Make sure all errors propagate through future.
|
| + return defer(() {
|
| + if (!dirExists(libDir)) return [];
|
| return listDir(libDir, recursive: true);
|
| }).then((files) {
|
| return files
|
|
|