From a080844ddf0967bcdfdbc94bc639a7d1b23b6b06 Mon Sep 17 00:00:00 2001 From: Gandifil Date: Wed, 20 Dec 2023 23:25:54 +0300 Subject: [PATCH] Check arguments count. --- Contentless/Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Contentless/Program.cs b/Contentless/Program.cs index e53b8ee..14f757a 100644 --- a/Contentless/Program.cs +++ b/Contentless/Program.cs @@ -47,6 +47,10 @@ public static class Program { var referencesVersions = config.References.ToDictionary(x => x, x => (string)null, StringComparer.OrdinalIgnoreCase); if (config.References.Length > 0) { + if (args.Length < 2) { + Console.WriteLine("Please specify the full path of project file, you want to use"); + return; + } var csprojPath = args[1]; Console.WriteLine($"Using project file {csprojPath}"); var projectRootElement = ProjectRootElement.Open(csprojPath);