Had the problem that a Webpart which has queried the User Profile Store and accessed some data from the User Profiles crashed…The Problem were that I didn’t check the Value against null.
Here is the best way to get Data from a UserProfile. See also the PropertyConstant Way. Didn’t know this….
string xy = (_userProfile[PropertyConstants.AccountName].Value ?? „N/A“).ToString();