diff options
author | Jose <jose@zeroc.com> | 2020-04-21 14:57:17 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2020-04-21 14:57:17 +0200 |
commit | b07dc82a20b352d53831890da3be09dd2555440f (patch) | |
tree | 120e88c04fe5e432eef8c49cc35f58670da3bf67 /csharp/src | |
parent | Fix C# OutputStream FormatType initialization - Close #662 (diff) | |
download | ice-b07dc82a20b352d53831890da3be09dd2555440f.tar.bz2 ice-b07dc82a20b352d53831890da3be09dd2555440f.tar.xz ice-b07dc82a20b352d53831890da3be09dd2555440f.zip |
Use TryGetValue instead of operator [] - Close #666
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/IceBox/ServiceManagerI.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/csharp/src/IceBox/ServiceManagerI.cs b/csharp/src/IceBox/ServiceManagerI.cs index 71b0a30409f..68b47540f31 100644 --- a/csharp/src/IceBox/ServiceManagerI.cs +++ b/csharp/src/IceBox/ServiceManagerI.cs @@ -290,8 +290,8 @@ class ServiceManagerI : ServiceManagerDisp_ if(loadOrder[i].Length > 0) { string key = prefix + loadOrder[i]; - string value = services[key]; - if(value == null) + string value; + if(!services.TryGetValue(key, out value)) { FailureException ex = new FailureException(); ex.reason = "ServiceManager: no service definition for `" + loadOrder[i] + "'"; |