summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs')
-rw-r--r--src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs b/src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs
index 1c3062f..88a1615 100644
--- a/src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs
+++ b/src/DotNetOpenAuth/Configuration/HostNameOrRegexCollection.cs
@@ -38,7 +38,9 @@ namespace DotNetOpenAuth.Configuration {
internal IEnumerable<Regex> KeysAsRegexs {
get {
foreach (HostNameElement element in this) {
- yield return new Regex(element.Name);
+ if (element.Name != null) {
+ yield return new Regex(element.Name);
+ }
}
}
}
@@ -61,7 +63,7 @@ namespace DotNetOpenAuth.Configuration {
/// An <see cref="T:System.Object"/> that acts as the key for the specified <see cref="T:System.Configuration.ConfigurationElement"/>.
/// </returns>
protected override object GetElementKey(ConfigurationElement element) {
- Contract.Assert(element != null); // this should be Contract.Requires in base class.
+ Contract.Assume(element != null); // this should be Contract.Requires in base class.
return ((HostNameElement)element).Name;
}
}