Allow plural localized strings to not specify every case (#45168)

* Allow plural localized strings to not specify every case
This commit is contained in:
Per Classon
2019-11-19 18:58:28 +01:00
committed by GitHub
parent e236196037
commit b5a85fcf48

View File

@@ -241,7 +241,7 @@ String genPluralMethod(Map<String, dynamic> bundle, String key) {
for(String pluralKey in pluralIds.keys) {
final RegExp expRE = RegExp('($pluralKey){([^}]+)}');
final RegExpMatch match = expRE.firstMatch(message);
if (match.groupCount == 2) {
if (match != null && match.groupCount == 2) {
String argValue = match.group(2);
for (String placeholder in placeholders)
argValue = argValue.replaceAll('#$placeholder#', '\$$placeholder');