diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-09-02 15:15:26 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-09-29 17:26:12 -0700 |
commit | a6a77cfd131282a8c3f69e8264eb35c08ac17532 (patch) | |
tree | 9b195d036db12264f20cd9fe350e68d9932eafe7 /src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs | |
parent | 5ceb75f6632a70c564b4556500b9c3e5a98bfa73 (diff) | |
download | DotNetOpenAuth-a6a77cfd131282a8c3f69e8264eb35c08ac17532.zip DotNetOpenAuth-a6a77cfd131282a8c3f69e8264eb35c08ac17532.tar.gz DotNetOpenAuth-a6a77cfd131282a8c3f69e8264eb35c08ac17532.tar.bz2 |
Fixes NullReferenceException in AspNet.OpenAuthSecurityManager.
This was reported at: http://stackoverflow.com/questions/12235395/openauth-requestauthentication-throws-null-ref-in-vs2012-web-forms-template/12240150#12240150
It is due to fields being left uninitialized by the constructors yet assumed to be non-null by all or some public methods.
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs b/src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs index 6a898a1..2d18b7b 100644 --- a/src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs +++ b/src/DotNetOpenAuth.AspNet/OpenAuthSecurityManager.cs @@ -64,15 +64,6 @@ namespace DotNetOpenAuth.AspNet { /// <param name="requestContext"> /// The request context. /// </param> - public OpenAuthSecurityManager(HttpContextBase requestContext) - : this(requestContext, provider: null, dataProvider: null) { } - - /// <summary> - /// Initializes a new instance of the <see cref="OpenAuthSecurityManager"/> class. - /// </summary> - /// <param name="requestContext"> - /// The request context. - /// </param> /// <param name="provider"> /// The provider. /// </param> @@ -81,9 +72,9 @@ namespace DotNetOpenAuth.AspNet { /// </param> public OpenAuthSecurityManager( HttpContextBase requestContext, IAuthenticationClient provider, IOpenAuthDataProvider dataProvider) { - if (requestContext == null) { - throw new ArgumentNullException("requestContext"); - } + Requires.NotNull(requestContext, "requestContext"); + Requires.NotNull(provider, "provider"); + Requires.NotNull(dataProvider, "dataProvider"); this.requestContext = requestContext; this.dataProvider = dataProvider; |