Skip to content

Commit 1721e53

Browse files
committed
Quick fix
1 parent 94adbcb commit 1721e53

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Common/Extensions/ConfigurationExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public static ConfigurationOptions RegisterRedisOptions(this WebApplicationBuild
4242
else
4343
{
4444
if (string.IsNullOrEmpty(section.Host)) throw new InvalidOperationException("Redis Host field is required if no connectionstring is specified (OpenShock:Redis:Host).");
45-
if (string.IsNullOrEmpty(section.User)) throw new InvalidOperationException("Redis User field is required if no connectionstring is specified (OpenShock:Redis:User).");
4645

4746
// Parse port with sane default + validation
4847
ushort port = 6379;
@@ -54,7 +53,7 @@ public static ConfigurationOptions RegisterRedisOptions(this WebApplicationBuild
5453

5554
options = new ConfigurationOptions
5655
{
57-
User = section.User,
56+
User = section.User ?? string.Empty,
5857
Password = section.Password ?? string.Empty,
5958
Ssl = false,
6059
EndPoints = { { section.Host, port } },

0 commit comments

Comments
 (0)