Permalink
Browse files

Fixed OpenID RP's CustomStore sample class that throws NullReferenceE…

…xception in some cases.

Thanks to Richard Collette for identifying the problem and suggesting the fix.
  • Loading branch information...
1 parent 01ff3ee commit 33f507ca5708940cdab371f1b33045c1c308aef5 @AArnott AArnott committed May 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs
@@ -84,7 +84,7 @@ public class CustomStore : IOpenIdApplicationStore {
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) {

0 comments on commit 33f507c

Please sign in to comment.