Proposed fix for bug 29450. Don't use the current user's gender for invalid users.