From 27b9b3c00ed4ee015797a1a1457e83167386e01c Mon Sep 17 00:00:00 2001 From: Teshvier Mathura Date: Mon, 3 Aug 2020 16:41:45 +0200 Subject: [PATCH] fix index out of bounds error --- Spacearr.Changelog.Generator/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Spacearr.Changelog.Generator/Program.cs b/Spacearr.Changelog.Generator/Program.cs index 244e401..2910eb5 100644 --- a/Spacearr.Changelog.Generator/Program.cs +++ b/Spacearr.Changelog.Generator/Program.cs @@ -1,6 +1,7 @@ using Autofac; using Spacearr.Common.Services.Interfaces; using System; +using System.Linq; using System.Threading.Tasks; namespace Spacearr.Changelog.Generator @@ -15,7 +16,7 @@ public static async Task Main(string[] args) Console.WriteLine("Too many arguments supplied, supply only the 'GitHub Owner', 'GitHub Repo', 'Directory Of Clone', 'GitHub Token'"); Console.ForegroundColor = ConsoleColor.White; } - else if (string.IsNullOrWhiteSpace(args[0]) || string.IsNullOrWhiteSpace(args[1]) || string.IsNullOrWhiteSpace(args[2]) || string.IsNullOrWhiteSpace(args[3]) || string.IsNullOrWhiteSpace(args[4])) + else if (args.Any(string.IsNullOrWhiteSpace)) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("One of the arguments is blank");