Skip to content

Commit a0ce585

Browse files
committed
Crash fix
#34
1 parent 69bcba8 commit a0ce585

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FreePackages/Data/ASFInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
namespace FreePackages {
1717
internal static class ASFInfo {
1818
private static Uri Source = new("https://gist.githubusercontent.com/C4illin/e8c5cf365d816f2640242bf01d8d3675/raw/Steam%2520Codes");
19+
private static readonly Regex SourceLine = new Regex("(?<type>[as])/(?<id>[0-9]+)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); // Match examples: a/12345 or s/12345
1920
private static TimeSpan UpdateFrequency = TimeSpan.FromHours(1);
2021

2122
private static Timer UpdateTimer = new(async e => await DoUpdate().ConfigureAwait(false), null, Timeout.Infinite, Timeout.Infinite);
@@ -61,8 +62,7 @@ private static async Task DoUpdate() {
6162
continue;
6263
}
6364

64-
// Match examples: a/12345 or s/12345
65-
Match item = Regex.Match(line, "(?<type>[as])/(?<id>[0-9]+)");
65+
Match item = SourceLine.Match(line);
6666

6767
if (!item.Success) {
6868
ASF.ArchiLogger.LogGenericError(String.Format("{0}: {1}", Strings.ASFInfoParseFailed, line));

0 commit comments

Comments
 (0)