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 126.96.36.199 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>