forked from firka/flutter
[flutter_tool] Improve yaml font map validation (#42538)
This commit is contained in:
@@ -439,8 +439,13 @@ void _validateFonts(YamlList fonts, List<String> errors) {
|
||||
errors.add('Expected "fonts" to either be null or a list.');
|
||||
continue;
|
||||
}
|
||||
for (final YamlMap fontListItem in fontMap['fonts']) {
|
||||
for (final MapEntry<dynamic, dynamic> kvp in fontListItem.entries) {
|
||||
for (final dynamic fontListItem in fontMap['fonts']) {
|
||||
if (fontListItem is! YamlMap) {
|
||||
errors.add('Expected "fonts" to be a list of maps.');
|
||||
continue;
|
||||
}
|
||||
final YamlMap fontMapList = fontListItem;
|
||||
for (final MapEntry<dynamic, dynamic> kvp in fontMapList.entries) {
|
||||
if (kvp.key is! String) {
|
||||
errors.add('Expected "${kvp.key}" under "fonts" to be a string.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user