catch worst-case

This commit is contained in:
Jakob 2022-11-04 17:16:19 +01:00
parent 3cdc8a0172
commit 91442e7edd

View file

@ -174,11 +174,18 @@ namespace EnvyUpdate
//protocol agnostic url
gpuURL = "https:" + gpuURL;
}
else
else if (gpuURL.StartsWith("driverResults.aspx"))
{
//relative url
gpuURL = "https://www.nvidia.com/Download/" + gpuURL;
}
else
{
//panic.
MessageBox.Show("ERROR: Invalid API response from Nvidia. Please file an issue on GitHub.");
Environment.Exit(10);
}
string pContent = c.DownloadString(gpuURL);
var pattern = @"Windows\/\d{3}\.\d{2}";
Regex rgx = new Regex(pattern);