U4-3908 - YSOD on frontend after being logged out

Created by Stephan 18 Dec 2013, 09:36:23 Updated by Stephan 19 Dec 2013, 10:12:36

Front-end request, UmbracoContext.DetectInPreviewModeFromRequest wants to check that UmbracoContext.UmbracoUser is not null. That property getter returns new User(Security.CurrentUser) -- and if no user is logged in, Security.CurrentUser is null and the User..ctor throws a NullReferenceException.

Suggested fix: var user = Security.CurrentUser; return user == null ? null : new User(user);

(No time to fix it by myself right now)

Comments

Stephan 19 Dec 2013, 09:56:40

Fixed in 7.0.2 with dc727ba !


Sebastiaan Janssen 19 Dec 2013, 10:10:53

For reference, pull request: https://github.com/umbraco/Umbraco-CMS/pull/274


Stephan 19 Dec 2013, 10:12:36

Thanks Sebastiaan for doing the cleaning after me ;-)


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.0.1

Due in version: 7.0.2

Sprint:

Story Points:

Cycle: