This commit is contained in:
Imran Remtulla
2023-10-03 21:34:24 -04:00
parent 5fbb1c2e32
commit 7bfc5ae0a8

View File

@@ -120,14 +120,14 @@ class HTML extends AppSource {
GeneratedFormTextField('matchGroupToUse', GeneratedFormTextField('matchGroupToUse',
label: tr('matchGroupToUse'), label: tr('matchGroupToUse'),
required: false, required: false,
hint: '1', hint: '0',
textInputType: const TextInputType.numberWithOptions(), textInputType: const TextInputType.numberWithOptions(),
additionalValidators: [ additionalValidators: [
(value) { (value) {
if (value?.isEmpty == true) { if (value?.isEmpty == true) {
value = null; value = null;
} }
value ??= '1'; value ??= '0';
return intValidator(value); return intValidator(value);
} }
]) ])
@@ -216,8 +216,12 @@ class HTML extends AppSource {
if (match.isEmpty) { if (match.isEmpty) {
throw NoVersionError(); throw NoVersionError();
} }
version = match.last String matchGroupString =
.group(int.parse(additionalSettings['matchGroupToUse'] as String)); (additionalSettings['matchGroupToUse'] as String).trim();
if (matchGroupString.isEmpty) {
matchGroupString = "0";
}
version = match.last.group(int.parse(matchGroupString));
if (version?.isEmpty == true) { if (version?.isEmpty == true) {
throw NoVersionError(); throw NoVersionError();
} }