diff options
Diffstat (limited to 'src/main.lib/Services/ArgumentsService.cs')
-rw-r--r-- | src/main.lib/Services/ArgumentsService.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.lib/Services/ArgumentsService.cs b/src/main.lib/Services/ArgumentsService.cs index 685ca55..2ec6022 100644 --- a/src/main.lib/Services/ArgumentsService.cs +++ b/src/main.lib/Services/ArgumentsService.cs @@ -17,6 +17,10 @@ namespace PKISharp.WACS.Services if (_mainArguments == null) { _mainArguments = _parser.GetArguments<MainArguments>(); + if (_mainArguments == null) + { + _mainArguments = new MainArguments(); + } } return _mainArguments; } @@ -28,7 +32,7 @@ namespace PKISharp.WACS.Services _parser = parser; } - public T GetArguments<T>() where T : class, new() => _parser.GetArguments<T>(); + public T? GetArguments<T>() where T : class, new() => _parser.GetArguments<T>(); public async Task<string?> TryGetArgument(string? providedValue, IInputService input, string what, bool secret = false) => await TryGetArgument(providedValue, input, new[] { what }, secret); |