Fix tool exit message shown when user provides a non-list to "assets" for a deferred component (#137837)

Fixes #136163
This commit is contained in:
Andrew Kolos
2023-11-05 20:01:25 -08:00
committed by GitHub
parent aa82e222d3
commit 12de94d152
2 changed files with 2 additions and 2 deletions

View File

@@ -642,7 +642,7 @@ void _validateDeferredComponents(MapEntry<Object?, Object?> kvp, List<String> er
if (valueMap.containsKey('assets')) {
final Object? assets = valueMap['assets'];
if (assets is! YamlList) {
errors.add('Expected "assets" key in the $i element of "${kvp.key}" to be a list, but got $assets (${assets.runtimeType}).');
errors.add('Expected "assets" to be a list, but got $assets (${assets.runtimeType}).');
} else {
_validateListType<String>(assets, errors, '"assets" key in the $i element of "${kvp.key}"', 'file paths');
}

View File

@@ -1459,7 +1459,7 @@ flutter:
);
expect(flutterManifest, null);
expect(logger.errorText, 'Expected "assets" key in the 0 element of "deferred-components" to be a list, but got blah (String).\n');
expect(logger.errorText, 'Expected "assets" to be a list, but got blah (String).\n');
});
testWithoutContext('FlutterManifest parses asset-only deferred components', () async {