Commit 9f0442b6 authored by Marc Gravell's avatar Marc Gravell

Merge branch 'patch-1' of https://github.com/stas-sultanov/StackExchange.Redis...

Merge branch 'patch-1' of https://github.com/stas-sultanov/StackExchange.Redis into stas-sultanov-patch-1

Conflicts:
	StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs

Note: tweaked a bit
parent 01b1ba66
......@@ -263,6 +263,8 @@ public CommandMap CommandMap
/// <summary>
/// Parse the configuration from a comma-delimited configuration string
/// </summary>
/// <exception cref="ArgumentNullException"><paramref name="configuration"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException"><paramref name="configuration"/> is empty.</exception>
public static ConfigurationOptions Parse(string configuration)
{
var options = new ConfigurationOptions();
......@@ -272,6 +274,8 @@ public static ConfigurationOptions Parse(string configuration)
/// <summary>
/// Parse the configuration from a comma-delimited configuration string
/// </summary>
/// <exception cref="ArgumentNullException"><paramref name="configuration"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException"><paramref name="configuration"/> is empty.</exception>
public static ConfigurationOptions Parse(string configuration, bool ignoreUnknown)
{
var options = new ConfigurationOptions();
......@@ -456,9 +460,18 @@ void Clear()
private void DoParse(string configuration, bool ignoreUnknown)
{
Clear();
if (!string.IsNullOrWhiteSpace(configuration))
if (configuration == null)
{
throw new ArgumentNullException("configuration");
}
if (string.IsNullOrWhiteSpace(configuration))
{
throw new ArgumentException("is empty", configuration);
}
Clear();
// break it down by commas
var arr = configuration.Split(StringSplits.Comma);
Dictionary<string, string> map = null;
......@@ -561,5 +574,4 @@ private void DoParse(string configuration, bool ignoreUnknown)
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment