Looks like a missing null check again.
Simple enough oversight if that is the case, and if so, might be worth checking where else profile is used.
I have a local copy of BE 18.104.22.168 but can't seem to find this code, so unable to test, but something along the lines of the following might be worth a try.
<div class="user-nav-name"><a href="~/admin/#/security/profile">@profile.DisplayName</a>
<div class="user-nav-name"><a href="~/admin/#/security/profile">@(profile != null ? profile.DisplayName : Security.CurrentUser.Identity.Name)</a>