Check if preferences object exists before checking its ui key in UserSessionService.