I notice User.Identity.Name appears to return the empty string when there is no user authenticated, rather than throwing a null reference exception.
It is valid to assume User.Identity.Name will never throw? Or should I be checking for null Identity before access.
I believe that the User object can be null if you haven’t called
or
It would probably be best to wrap in a try catch.