summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-06-01 07:47:59 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-06-01 07:47:59 -0700
commit89f083a33793af1b34964230e274fefa3c68831e (patch)
tree6f51036f52fe9002ade52bdf821cca877dee53b6 /src
parentf00c9430bb49d0dcd54005c852fd2b7d7de2ce7e (diff)
downloadDotNetOpenAuth-89f083a33793af1b34964230e274fefa3c68831e.zip
DotNetOpenAuth-89f083a33793af1b34964230e274fefa3c68831e.tar.gz
DotNetOpenAuth-89f083a33793af1b34964230e274fefa3c68831e.tar.bz2
Fixed NullReferenceException.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/OAuthWrap/ChannelElements/DataBag.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/OAuthWrap/ChannelElements/DataBag.cs b/src/DotNetOpenAuth/OAuthWrap/ChannelElements/DataBag.cs
index 0b0bd3a..e10f08c 100644
--- a/src/DotNetOpenAuth/OAuthWrap/ChannelElements/DataBag.cs
+++ b/src/DotNetOpenAuth/OAuthWrap/ChannelElements/DataBag.cs
@@ -32,10 +32,11 @@ namespace DotNetOpenAuth.OAuthWrap.ChannelElements {
protected DataBag(OAuthWrapAuthorizationServerChannel channel, bool signed = false, bool encrypted = false, bool compressed = false, TimeSpan? maximumAge = null, INonceStore decodeOnceOnly = null)
: base(Protocol.Default.Version) {
Contract.Requires<ArgumentNullException>(channel != null, "channel");
+ Contract.Requires<ArgumentException>(channel.AuthorizationServer != null);
Contract.Requires<ArgumentException>(signed || decodeOnceOnly == null, "A signature must be applied if this data is meant to be decoded only once.");
Contract.Requires<ArgumentException>(maximumAge.HasValue || decodeOnceOnly == null, "A maximum age must be given if a message can only be decoded once.");
- this.Hasher = new HMACSHA256(this.Channel.AuthorizationServer.Secret);
+ this.Hasher = new HMACSHA256(channel.AuthorizationServer.Secret);
this.Channel = channel;
this.signed = signed;
this.maximumAge = maximumAge;