Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console environment: Thread.CurrentPrincipal is null #580

Closed
tusmester opened this issue Feb 21, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@tusmester
Copy link
Member

commented Feb 21, 2019

It is possible for Thread.CurrentPrincipal to be null in a .Net Core console environment. This causes the DesktopAccessProvider.CurrentUser property to fail.

Solution: add a question mark.

if (Thread.CurrentPrincipal?.Identity is IUser user)
   return user;

@tusmester tusmester added the bug label Feb 21, 2019

@tusmester tusmester added this to the Sprint 180 milestone Mar 11, 2019

@kultsar kultsar modified the milestones: Sprint 180, Sprint 181, Sprint 182 Mar 27, 2019

@kultsar kultsar modified the milestones: Sprint 182, Sprint 183 Apr 17, 2019

@kultsar kultsar modified the milestones: Sprint 183, Sprint 184 May 2, 2019

@kultsar kultsar modified the milestones: Sprint 184, Sprint 185 May 15, 2019

@kultsar kultsar modified the milestones: Sprint 185, Sprint 186 May 29, 2019

@herflis herflis modified the milestones: Sprint 186, Sprint 187 Jun 18, 2019

@herflis herflis closed this Jun 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.