diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-01-23 20:22:13 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-01-23 20:22:13 -0600 |
| commit | 10b7ca09e642c6ee1ffcfa3e5fe9198afa13c1d7 (patch) | |
| tree | 547094afc36bdf1835dd182c7fe0e8ee7c9c2b0e /src | |
| parent | 81ed61f9f6e76db77a709a6fa024b1ea95df38b3 (diff) | |
| download | slskd-10b7ca09e642c6ee1ffcfa3e5fe9198afa13c1d7.tar.gz | |
coalesce nulls
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Common/Configuration/CommandLineConfigurationSource.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Common/Configuration/EnvironmentVariableConfigurationSource.cs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs b/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs index a6b46496..c65e316b 100644 --- a/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs +++ b/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs @@ -109,7 +109,7 @@ if (NormalizeKey) { - key = key.Replace("-", string.Empty).Replace("_", string.Empty).ToLowerInvariant(); + key = key?.Replace("-", string.Empty).Replace("_", string.Empty).ToLowerInvariant(); } if (string.IsNullOrEmpty(key)) diff --git a/src/slskd/Common/Configuration/EnvironmentVariableConfigurationSource.cs b/src/slskd/Common/Configuration/EnvironmentVariableConfigurationSource.cs index fe470be6..bfbb8558 100644 --- a/src/slskd/Common/Configuration/EnvironmentVariableConfigurationSource.cs +++ b/src/slskd/Common/Configuration/EnvironmentVariableConfigurationSource.cs @@ -108,7 +108,7 @@ if (NormalizeKey) { - key = key.Replace("_", string.Empty).Replace("-", string.Empty).ToLowerInvariant(); + key = key?.Replace("_", string.Empty).Replace("-", string.Empty).ToLowerInvariant(); } if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(name)) |
