diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-08 09:07:59 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-08 09:07:59 -0700 |
commit | f64b12624553daa62376c933fb37abe667306749 (patch) | |
tree | abc3d0f7c5a0c39166823379c04a9bb16b4ef37c /src | |
parent | 07235e4d3aa03c3ea3597ad3f21e1cd265b81702 (diff) | |
download | DotNetOpenAuth-f64b12624553daa62376c933fb37abe667306749.zip DotNetOpenAuth-f64b12624553daa62376c933fb37abe667306749.tar.gz DotNetOpenAuth-f64b12624553daa62376c933fb37abe667306749.tar.bz2 |
Fixed unhandled NullReferenceException when an OpenIdButton's discovery fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButton.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButton.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButton.cs index 8b517b4..a090032 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButton.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButton.cs @@ -118,8 +118,12 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// <param name="eventArgument">A <see cref="T:System.String"/> that represents an optional event argument to be passed to the event handler.</param> public void RaisePostBackEvent(string eventArgument) { if (!this.PrecreateRequest) { - IAuthenticationRequest request = this.CreateRequests().FirstOrDefault(); - request.RedirectToProvider(); + try { + IAuthenticationRequest request = this.CreateRequests().First(); + request.RedirectToProvider(); + } catch (InvalidOperationException ex) { + throw ErrorUtilities.Wrap(ex, OpenIdStrings.OpenIdEndpointNotFound); + } } } |