Skip to content

Commit 2535953

Browse files
mkelloggmhowlett
authored andcommitted
fixed error with schema registry config in .net 461 (#774)
* fixed error with schema registry config in .net 461 (bad assumption on Convert.ToString * remove net461 unit test project for now * undoing accidental sln add
1 parent 8e08c36 commit 2535953

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Confluent.SchemaRegistry/CachedSchemaRegistryClient.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ public CachedSchemaRegistryClient(IEnumerable<KeyValuePair<string, string>> conf
7878
try { this.identityMapCapacity = identityMapCapacityMaybe.Value == null ? DefaultMaxCachedSchemas : Convert.ToInt32(identityMapCapacityMaybe.Value); }
7979
catch (FormatException) { throw new ArgumentException($"Configured value for {SchemaRegistryConfig.PropertyNames.SchemaRegistryMaxCachedSchemas} must be an integer."); }
8080

81-
// Convert.ToString returns "" in the null case here.
82-
var basicAuthSource = Convert.ToString(config.FirstOrDefault(prop => prop.Key.ToLower() == SchemaRegistryConfig.PropertyNames.SchemaRegistryBasicAuthCredentialsSource).Value);
83-
var basicAuthInfo = Convert.ToString(config.FirstOrDefault(prop => prop.Key.ToLower() == SchemaRegistryConfig.PropertyNames.SchemaRegistryBasicAuthUserInfo).Value);
81+
var basicAuthSource = Convert.ToString(config.FirstOrDefault(prop => prop.Key.ToLower() == SchemaRegistryConfig.PropertyNames.SchemaRegistryBasicAuthCredentialsSource).Value) ?? "";
82+
var basicAuthInfo = Convert.ToString(config.FirstOrDefault(prop => prop.Key.ToLower() == SchemaRegistryConfig.PropertyNames.SchemaRegistryBasicAuthUserInfo).Value) ?? "";
8483

8584
string username = null;
8685
string password = null;

0 commit comments

Comments
 (0)