diff --git a/src/StackExchange.Redis/ServerEndPoint.cs b/src/StackExchange.Redis/ServerEndPoint.cs index 1bc968204..88eea3592 100644 --- a/src/StackExchange.Redis/ServerEndPoint.cs +++ b/src/StackExchange.Redis/ServerEndPoint.cs @@ -1094,7 +1094,7 @@ private void SetConfig(ref T field, T value, [CallerMemberName] string? calle } } internal static string ClientInfoSanitize(string? value) - { + => string.IsNullOrWhiteSpace(value) ? String.Empty : nameSanitizer.Replace(value!.Trim(), "-"); if (string.IsNullOrWhiteSpace(value)) return ""; return nameSanitizer.Replace(value!.Trim(), "-"); }