diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2021-04-24 00:04:12 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2021-04-24 00:04:12 +0200 |
| commit | 98b02b1af92e46f6fcd4e0d5e43410b8c6118f5c (patch) | |
| tree | c19bb6ceb670679e21ac0119ae99944240c80f54 /src | |
| parent | 3878e03950ae52a83105c40c6356afe00f356fc5 (diff) | |
| download | dotnet-helpers-98b02b1af92e46f6fcd4e0d5e43410b8c6118f5c.tar.xz dotnet-helpers-98b02b1af92e46f6fcd4e0d5e43410b8c6118f5c.zip | |
Check for IsNullOrWhiteSpace
UnicornFormatWithEnvironment: string.Replace() throws when replace value is null, add IsNullOrWhiteSpace check
Diffstat (limited to 'src')
| -rw-r--r-- | src/IOL.Helpers/StringHelpers.cs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/IOL.Helpers/StringHelpers.cs b/src/IOL.Helpers/StringHelpers.cs index c090117..3f80d6e 100644 --- a/src/IOL.Helpers/StringHelpers.cs +++ b/src/IOL.Helpers/StringHelpers.cs @@ -32,6 +32,7 @@ namespace IOL.Helpers var matchList = Regex.Matches(input, ""); foreach (var key in matchList.Select(match => match.Value)) { var value = configuration.GetValue<string>(key); + if (string.IsNullOrWhiteSpace(value)) continue; input = input.Replace(key, value); } |
