Adding missing break in plugin validation check (#43180)
This commit is contained in:
@@ -401,8 +401,9 @@ void _validateFlutter(YamlMap yaml, List<String> errors) {
|
||||
}
|
||||
break;
|
||||
case 'plugin':
|
||||
if (kvp.value is! YamlMap) {
|
||||
if (kvp.value is! YamlMap || kvp.value == null) {
|
||||
errors.add('Expected "${kvp.key}" to be an object, but got ${kvp.value} (${kvp.value.runtimeType}).');
|
||||
break;
|
||||
}
|
||||
final List<String> pluginErrors = Plugin.validatePluginYaml(kvp.value);
|
||||
errors.addAll(pluginErrors);
|
||||
|
||||
@@ -400,6 +400,18 @@ flutter:
|
||||
expect(flutterManifest.androidPackage, 'com.example');
|
||||
});
|
||||
|
||||
testUsingContext('handles an invalid plugin declaration', () async {
|
||||
final BufferLogger bufferLogger = context.get<Logger>();
|
||||
const String manifest = '''
|
||||
name: test
|
||||
flutter:
|
||||
plugin:
|
||||
''';
|
||||
final FlutterManifest flutterManifest = FlutterManifest.createFromString(manifest);
|
||||
expect(flutterManifest, null);
|
||||
expect(bufferLogger.errorText, contains('Expected "plugin" to be an object, but got null'));
|
||||
});
|
||||
|
||||
|
||||
Future<void> checkManifestVersion({
|
||||
String manifest,
|
||||
|
||||
Reference in New Issue
Block a user