mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Fix NRE in ViewerPageDataProvider. (#571)
This commit is contained in:
parent
c5a1a56bdf
commit
97e31b44fc
@ -21,8 +21,19 @@ namespace Remotely.Server.Services.RcImplementations
|
||||
|
||||
public string GetUserDisplayName(PageModel pageModel)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(pageModel?.User?.Identity?.Name))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var user = _dataService.GetUserByNameWithOrg(pageModel.User.Identity.Name);
|
||||
return user.UserOptions?.DisplayName ?? user.UserName;
|
||||
|
||||
if (user is null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return user.UserOptions?.DisplayName ?? user.UserName ?? string.Empty;
|
||||
}
|
||||
|
||||
public ViewerPageTheme GetTheme(PageModel pageModel)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user