Permalink
Browse files

Fix to EnsureCookies. If the source collection is null the Cookie col…

…lection is set only to the second call of EnsureCookies.
  • Loading branch information...
1 parent 85e5395 commit 2bc5cf142fae3d7cc87b642f4f639e0484011292 @gigi81 committed Mar 14, 2012
Showing with 4 additions and 11 deletions.
  1. +4 −11 SignalR/Hosting/RequestCookieCollection.cs
@@ -48,17 +48,10 @@ IEnumerator IEnumerable.GetEnumerator()
private void EnsureCookies()
{
- if (_cookies == null)
- {
- if (_cookieSource != null)
- {
- _cookies = new List<Cookie>(_cookieSource);
- }
- else
- {
- _cookieSource = new List<Cookie>();
- }
- }
+ if (_cookies != null)
+ return;
+
+ _cookies = new List<Cookie>(_cookieSource ?? new Cookie[0]);
}
}
}

0 comments on commit 2bc5cf1

Please sign in to comment.