From 7bfc5ae0a85fdf9dac8562d4530e814435b5a9a4 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Tue, 3 Oct 2023 21:34:24 -0400 Subject: [PATCH] Bugfix (#954) --- lib/app_sources/html.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/app_sources/html.dart b/lib/app_sources/html.dart index 60fc32d..4cb9b26 100644 --- a/lib/app_sources/html.dart +++ b/lib/app_sources/html.dart @@ -120,14 +120,14 @@ class HTML extends AppSource { GeneratedFormTextField('matchGroupToUse', label: tr('matchGroupToUse'), required: false, - hint: '1', + hint: '0', textInputType: const TextInputType.numberWithOptions(), additionalValidators: [ (value) { if (value?.isEmpty == true) { value = null; } - value ??= '1'; + value ??= '0'; return intValidator(value); } ]) @@ -216,8 +216,12 @@ class HTML extends AppSource { if (match.isEmpty) { throw NoVersionError(); } - version = match.last - .group(int.parse(additionalSettings['matchGroupToUse'] as String)); + String matchGroupString = + (additionalSettings['matchGroupToUse'] as String).trim(); + if (matchGroupString.isEmpty) { + matchGroupString = "0"; + } + version = match.last.group(int.parse(matchGroupString)); if (version?.isEmpty == true) { throw NoVersionError(); }