Unverified Commit 6c91a137 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Adding missing break in plugin validation check (#43180)

parent 8df0d655
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment