C# “Object reference not set to an instance of an object” Get Type / Get Property [duplicate]
问题 This question already has answers here : What is a NullReferenceException, and how do I fix it? (29 answers) Closed 3 years ago . Hi guys I'm receiving an error: "Object reference not set to an instance of an object". I'm not quite sure why... Here's the code: public void LoadUserContacts(ListBox FriendsLb) { FriendsLb.DisplayMember = "Display"; var query = from o in Globals.DB.Friends where o.UserEmail == Properties.Settings.Default.Email select new { FirstName = o.FirstName, LastName = o