forked from firka/flutter
Ensure that different formatting of ndk properties file does not crash tool (#29528)
This commit is contained in:
@@ -216,10 +216,15 @@ class AndroidNdk {
|
||||
.split('\n')
|
||||
.map<String>((String line) => line.trim())
|
||||
.where((String line) => line.isNotEmpty);
|
||||
final Map<String, String> properties = Map<String, String>.fromIterable(
|
||||
propertiesFileLines.map<List<String>>((String line) => line.split(' = ')),
|
||||
key: (dynamic split) => split[0],
|
||||
value: (dynamic split) => split[1]);
|
||||
final Map<String, String> properties = <String, String>{};
|
||||
for (String line in propertiesFileLines) {
|
||||
final List<String> parts = line.split(' = ');
|
||||
if (parts.length == 2) {
|
||||
properties[parts[0]] = parts[1];
|
||||
} else {
|
||||
printError('Malformed line in ndk source.properties: "$line".');
|
||||
}
|
||||
}
|
||||
|
||||
if (!properties.containsKey('Pkg.Revision')) {
|
||||
throw AndroidNdkSearchError('Can not establish ndk-bundle version: $propertiesFile does not contain Pkg.Revision');
|
||||
|
||||
Reference in New Issue
Block a user