From 9040b1a3cb6bcebdc47e69bb6c3da010e7fdc3b1 Mon Sep 17 00:00:00 2001 From: efabioli Date: Fri, 11 May 2018 16:27:43 +0200 Subject: [PATCH] NullReferenceException Retrieving ExternalSignInAutoLinkOptions only if authType is not null. Issue found in version 7.9 too; not checked other versions. --- src/Umbraco.Web/Editors/BackOfficeController.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 13447a50ff..afd8902592 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -372,7 +372,7 @@ namespace Umbraco.Web.Editors { if (loginInfo == null) throw new ArgumentNullException("loginInfo"); if (response == null) throw new ArgumentNullException("response"); - + ExternalSignInAutoLinkOptions autoLinkOptions = null; //Here we can check if the provider associated with the request has been configured to allow // new users (auto-linked external accounts). This would never be used with public providers such as @@ -383,8 +383,10 @@ namespace Umbraco.Web.Editors { Logger.Warn("Could not find external authentication provider registered: " + loginInfo.Login.LoginProvider); } - - var autoLinkOptions = authType.GetExternalAuthenticationOptions(); + else + { + autoLinkOptions = authType.GetExternalAuthenticationOptions(); + } // Sign in the user with this external login provider if the user already has a login var user = await UserManager.FindAsync(loginInfo.Login);