Skip to content

Commit 977f765

Browse files
authored
Improve error when FLUTTER_ROOT is missing. (#2316)
This is a re-do, sort of, of #1714, which was broken in #2190.
1 parent 3e69043 commit 977f765

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/dartdoc_options.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,11 @@ Future<List<DartdocOption<Object>>> createDartdocOptions(
16031603
(option.root['topLevelPackageMeta'].valueAt(dir) as PackageMeta)
16041604
.requiresFlutter) {
16051605
String flutterRoot = option.root['flutterRoot'].valueAt(dir);
1606+
if (flutterRoot == null) {
1607+
// For now, return null. An error is reported in
1608+
// [PackageBuilder.buildPackageGraph].
1609+
return null;
1610+
}
16061611
return p.join(flutterRoot, 'bin', 'cache', 'dart-sdk');
16071612
}
16081613
return defaultSdkDir.absolute.path;

0 commit comments

Comments
 (0)