Prevent NPEs when not logged in for endpoints where logging in is optional.