Skip to content

Commit 2d4ec1e

Browse files
Update lib/src/builder.dart
Co-authored-by: Nate Bosch <[email protected]>
1 parent bc06f9f commit 2d4ec1e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/src/builder.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ class MockBuilder implements Builder {
7676
final entryLib = await buildStep.inputLibrary;
7777
final sourceLibIsNonNullable = entryLib.isNonNullableByDefault;
7878

79-
if (buildStep.allowedOutputs.length > 1) {
80-
throw ArgumentError('Build_extensions has conflicting outputs on file '
81-
'`${buildStep.inputId.path}`, it usually caused by missconfiguration '
82-
'on your `build.yaml` file');
79+
final mockLibraryAsset = buildStep.allowedOutputs.singleOrNull;
80+
if (mockLibraryAsset == null) {
81+
throw ArgumentError('Build_extensions has missing or conflicting outputs for '
82+
'`${buildStep.inputId.path}`, this is usually caused by a misconfigured '
83+
'build extension override in `build.yaml`');
8384
}
84-
final mockLibraryAsset = buildStep.allowedOutputs.single;
8585

8686
final inheritanceManager = InheritanceManager3();
8787
final mockTargetGatherer =

0 commit comments

Comments
 (0)