U4-2965 - Preview mode triggers Ysod

Created by Per Ploug 27 Sep 2013, 08:12:27 Updated by Sebastiaan Janssen 08 Oct 2013, 13:59:09

Duplicates: U4-2952

Setting a document in preview mode, makes the entire system throw a ysod, both when view the preview, and browsing the backoffice:

public static UmbracoBackOfficeIdentity GetCurrentIdentity(this HttpContextBase http) Line 15: { Line 16: return http.User.Identity as UmbracoBackOfficeIdentity;
Line 17: }

[NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Core.Security.AuthenticationExtensions.GetCurrentIdentity(HttpContextBase http) in c:\Umbraco-CMS\src\Umbraco.Core\Security\AuthenticationExtensions.cs:16 Umbraco.Web.Security.WebSecurity.GetUserId() in c:\Umbraco-CMS\src\Umbraco.Web\Security\WebSecurity.cs:259 Umbraco.Web.Security.WebSecurity.get_CurrentUser() in c:\Umbraco-CMS\src\Umbraco.Web\Security\WebSecurity.cs:119 Umbraco.Web.UmbracoContext.get_UmbracoUser() in c:\Umbraco-CMS\src\Umbraco.Web\UmbracoContext.cs:394 Umbraco.Web.UmbracoContext.DetectInPreviewModeFromRequest() in c:\Umbraco-CMS\src\Umbraco.Web\UmbracoContext.cs:412 Umbraco.Web.UmbracoContext..ctor(HttpContextBase httpContext, ApplicationContext applicationContext, IPublishedCaches publishedCaches, WebSecurity webSecurity, Nullable`1 preview) in c:\Umbraco-CMS\src\Umbraco.Web\UmbracoContext.cs:201 Umbraco.Web.UmbracoContext.EnsureContext(HttpContextBase httpContext, ApplicationContext applicationContext, WebSecurity webSecurity, Boolean replaceContext) in c:\Umbraco-CMS\src\Umbraco.Web\UmbracoContext.cs:142 Umbraco.Web.UmbracoModule.BeginRequest(HttpContextBase httpContext) in c:\Umbraco-CMS\src\Umbraco.Web\UmbracoModule.cs:69 Umbraco.Web.UmbracoModule.b__5(Object sender, EventArgs e) in c:\Umbraco-CMS\src\Umbraco.Web\UmbracoModule.cs:577 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +79 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164

Comments

Priority: Normal

Type: Bug

State: Duplicate

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: