Update Program.cs

Update validation condition
This commit is contained in:
Alex_Z 2021-05-20 16:25:23 +03:00 committed by GitHub
parent c78306518d
commit ae6da28899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@
{
var jsonData = File.ReadAllText(json.FullName)["downloads(".Length..^1];
var items = JsonSerializer.Deserialize<ResponseItem[]>(jsonData, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
foreach (var item in items.Where(a=>a.ZipUrl.ToString().EndsWith(archiveType) && !a.ZipUrl .ToString().Contains("-war")))
foreach (var item in items.Where(a=>a.ZipUrl != null && a.ZipUrl.ToString().EndsWith(archiveType) && !a.ZipUrl .ToString().Contains("-war")))
{
var majorVersion = item.Version.Split(".").First();
var templatePath = Path.Combine(workdir.FullName, product, "templates", majorVersion);