diff --git a/youtube-dl-gui/Classes/SystemRegistry.cs b/youtube-dl-gui/Classes/SystemRegistry.cs index 0b7d596b..9f418500 100644 --- a/youtube-dl-gui/Classes/SystemRegistry.cs +++ b/youtube-dl-gui/Classes/SystemRegistry.cs @@ -12,8 +12,10 @@ public static bool CheckRegistry() { ProtocolKey.GetValue("URL Protocol") is not null && ProtocolKey.OpenSubKey("shell\\open\\command").GetValue("").ToString().ToLowerInvariant() == $"\"{Program.FullProgramPath}\" \"%1\"".ToLowerInvariant(); - ProtocolKey.Close(); - ProtocolKey.Dispose(); + if (ProtocolKey is not null) { + ProtocolKey.Close(); + ProtocolKey.Dispose(); + } return Available; } diff --git a/youtube-dl-gui/Program.cs b/youtube-dl-gui/Program.cs index e0551045..03a7a01e 100644 --- a/youtube-dl-gui/Program.cs +++ b/youtube-dl-gui/Program.cs @@ -365,6 +365,7 @@ internal static void KillForUpdate() { // Any downloads/conversion/merges in progress will finish before fully closing for updates. MainForm?.RemoveTrayIcon(); MainForm?.Dispose(); + Messages?.Dispose(); } internal static void SetTls() { diff --git a/youtube-dl-gui/Updater/API Data/GithubData.cs b/youtube-dl-gui/Updater/API Data/GithubData.cs index 5cb86f58..17ec8314 100644 --- a/youtube-dl-gui/Updater/API Data/GithubData.cs +++ b/youtube-dl-gui/Updater/API Data/GithubData.cs @@ -96,15 +96,15 @@ internal Version GetVersion() => /// private string FindHash() { if (!VersionDescription.IsNullEmptyWhitespace()) { - MatchCollection Matches = Regex.Matches(VersionDescription, "(?<=exe sha-256: )[0-9a-fA-F]{64}(?=)"); + MatchCollection Matches = Regex.Matches(VersionDescription, "(?<=exe sha-256: )(`)?[0-9a-fA-F]{64}(`)?(?=)"); if (Matches.Count > 0) { return Matches[0].Value; } - Matches = Regex.Matches(VersionDescription, "(?<=exe sha256: )[0-9a-fA-F]{64}(?=)"); + Matches = Regex.Matches(VersionDescription, "(?<=exe sha256: )(`)?[0-9a-fA-F]{64}(`)?(?=)"); if (Matches.Count > 0) { return Matches[0].Value; } - Matches = Regex.Matches(VersionDescription, "(?<=exe sha 256: )[0-9a-fA-F]{64}(?=)"); + Matches = Regex.Matches(VersionDescription, "(?<=exe sha 256: )(`)?[0-9a-fA-F]{64}(`)?(?=)"); if (Matches.Count > 0) { return Matches[0].Value; }