summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-05-10 20:53:01 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2012-05-10 20:54:00 -0700
commit33f507ca5708940cdab371f1b33045c1c308aef5 (patch)
tree58679d5855e674b38177e5135ec6e7867dab3515 /samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs
parent01ff3ee1aa3209b9dfd9b9456f05a3a9c0b1234d (diff)
downloadDotNetOpenAuth-33f507ca5708940cdab371f1b33045c1c308aef5.zip
DotNetOpenAuth-33f507ca5708940cdab371f1b33045c1c308aef5.tar.gz
DotNetOpenAuth-33f507ca5708940cdab371f1b33045c1c308aef5.tar.bz2
Fixed OpenID RP's CustomStore sample class that throws NullReferenceException in some cases.
Thanks to Richard Collette for identifying the problem and suggesting the fix.
Diffstat (limited to 'samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs')
-rw-r--r--samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs b/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs
index f521c0e..1572c05 100644
--- a/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs
+++ b/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs
@@ -84,7 +84,7 @@ namespace OpenIdRelyingPartyWebForms.Code {
public CryptoKey GetKey(string bucket, string handle) {
var assocRow = dataSet.CryptoKey.FindByBucketHandle(bucket, handle);
- return new CryptoKey(assocRow.Secret, assocRow.ExpiresUtc);
+ return assocRow == null ? null : new CryptoKey(assocRow.Secret, assocRow.ExpiresUtc);
}
public IEnumerable<KeyValuePair<string, CryptoKey>> GetKeys(string bucket) {