diff options
Diffstat (limited to 'src/DotNetOAuth/Messaging')
-rw-r--r-- | src/DotNetOAuth/Messaging/DictionaryXmlReader.cs | 10 | ||||
-rw-r--r-- | src/DotNetOAuth/Messaging/MessagingUtilities.cs | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs b/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs index 5eae4c7..7a5dc21 100644 --- a/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs +++ b/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs @@ -24,6 +24,9 @@ namespace DotNetOAuth.Messaging { /// <param name="fields">The dictionary to read data from.</param>
/// <returns>The XmlReader that will read the data out of the given dictionary.</returns>
internal static XmlReader Create(XName rootElement, IDictionary<string, string> fields) {
+ if (rootElement == null) {
+ throw new ArgumentNullException("rootElement");
+ }
if (fields == null) {
throw new ArgumentNullException("fields");
}
@@ -38,6 +41,10 @@ namespace DotNetOAuth.Messaging { /// <param name="fields">The dictionary to list values from.</param>
/// <returns>The generated <see cref="XmlReader"/>.</returns>
private static XmlReader CreateRoundtripReader(XName rootElement, IDictionary<string, string> fields) {
+ if (rootElement == null) {
+ throw new ArgumentNullException("rootElement");
+ }
+
MemoryStream stream = new MemoryStream();
XmlWriter writer = XmlWriter.Create(stream);
SerializeDictionaryToXml(writer, rootElement, fields);
@@ -62,6 +69,9 @@ namespace DotNetOAuth.Messaging { if (writer == null) {
throw new ArgumentNullException("writer");
}
+ if (rootElement == null) {
+ throw new ArgumentNullException("rootElement");
+ }
if (fields == null) {
throw new ArgumentNullException("fields");
}
diff --git a/src/DotNetOAuth/Messaging/MessagingUtilities.cs b/src/DotNetOAuth/Messaging/MessagingUtilities.cs index c298b2f..e8069f6 100644 --- a/src/DotNetOAuth/Messaging/MessagingUtilities.cs +++ b/src/DotNetOAuth/Messaging/MessagingUtilities.cs @@ -82,6 +82,10 @@ namespace DotNetOAuth.Messaging { /// If null, <paramref name="builder"/> is not changed.
/// </param>
internal static void AppendQueryArgs(UriBuilder builder, IDictionary<string, string> args) {
+ if (builder == null) {
+ throw new ArgumentNullException("builder");
+ }
+
if (args != null && args.Count > 0) {
StringBuilder sb = new StringBuilder(50 + (args.Count * 10));
if (!string.IsNullOrEmpty(builder.Query)) {
|