Skip to content

Commit

Permalink
do not crash on emtpy/null secrets path
Browse files Browse the repository at this point in the history
  • Loading branch information
WouterTinus committed Sep 30, 2021
1 parent f65965d commit 519f26f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.lib/Services/JsonSecretService.cs
Expand Up @@ -32,8 +32,12 @@ public JsonSecretService(ISettingsService settings, ILogService log)
{
_log = log;
_settings = settings;
var fallback = Path.Join(settings.Client.ConfigurationPath, "secrets.json");
_file = new FileInfo(_settings.Secrets?.Json?.FilePath ?? fallback);
var path = _settings.Secrets?.Json?.FilePath;
if (string.IsNullOrWhiteSpace(path))
{
path = Path.Join(settings.Client.ConfigurationPath, "secrets.json");
}
_file = new FileInfo(path);
_secrets = new List<CredentialEntry>();
if (_file.Exists)
{
Expand Down

0 comments on commit 519f26f

Please sign in to comment.