diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-05-08 11:36:41 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-05-08 11:36:41 -0700 |
commit | 35e6f1fa6daa3afb0d652d6e00a8f18ced4680a4 (patch) | |
tree | 3eaeee625c857f6d6f68c862106fc2438e0ac7d8 | |
parent | 3a5a761063327f919d72d04e47968c8556a6fd36 (diff) | |
download | DotNetOpenAuth-35e6f1fa6daa3afb0d652d6e00a8f18ced4680a4.zip DotNetOpenAuth-35e6f1fa6daa3afb0d652d6e00a8f18ced4680a4.tar.gz DotNetOpenAuth-35e6f1fa6daa3afb0d652d6e00a8f18ced4680a4.tar.bz2 |
We no longer emit a warning when dropping null keys with null or empty values.
Fixes Trac #194
-rw-r--r-- | src/DotNetOpenAuth/Messaging/MessagingUtilities.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs index 231637a..5dccc7a 100644 --- a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs +++ b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs @@ -780,7 +780,10 @@ namespace DotNetOpenAuth.Messaging { if (throwOnNullKey) { throw new ArgumentException(MessagingStrings.UnexpectedNullKey); } else { - Logger.OpenId.WarnFormat("Null key with value {0} encountered while translating NameValueCollection to Dictionary.", nvc[key]); + // Only emit a warning if there was a non-empty value. + if (!string.IsNullOrEmpty(nvc[key])) { + Logger.OpenId.WarnFormat("Null key with value {0} encountered while translating NameValueCollection to Dictionary.", nvc[key]); + } } } else { dictionary.Add(key, nvc[key]); |