From 6d898ebbfa49e759667692291170cb1573abfea8 Mon Sep 17 00:00:00 2001 From: Daniil Pavliuchyk Date: Tue, 17 Dec 2024 13:48:33 +0200 Subject: [PATCH] chore: Check skip for null --- UnoCheck/CheckCommand.cs | 2 +- UnoCheck/CheckSettings.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/UnoCheck/CheckCommand.cs b/UnoCheck/CheckCommand.cs index efa8db4f..f9eac4b3 100644 --- a/UnoCheck/CheckCommand.cs +++ b/UnoCheck/CheckCommand.cs @@ -106,7 +106,7 @@ public override async Task ExecuteAsync(CommandContext context, CheckSettin settings.TargetPlatforms = ParseTfmsToTargetPlatforms(settings); if (!string.IsNullOrEmpty(settings.Ide)) { - var currentSkips = settings.Skip.ToList(); + var currentSkips = settings.Skip == null ? [] : settings.Skip.ToList(); switch (settings.Ide.ToLowerInvariant()) { case "rider": diff --git a/UnoCheck/CheckSettings.cs b/UnoCheck/CheckSettings.cs index 1429ef17..2cf7fd70 100644 --- a/UnoCheck/CheckSettings.cs +++ b/UnoCheck/CheckSettings.cs @@ -1,4 +1,5 @@ -using Spectre.Console.Cli; +#nullable enable +using Spectre.Console.Cli; using System.ComponentModel; namespace DotNetCheck @@ -15,7 +16,7 @@ public partial class CheckSettings : CommandSettings, IManifestChannelSettings public bool NonInteractive { get; set; } [CommandOption("-s|--skip ")] - public string[] Skip { get; set; } + public string[]? Skip { get; set; } [CommandOption("--pre|--preview|-d|--dev")] public bool Preview { get; set; }