private void btnAssignNew_Click(object sender, EventArgs e) { //assigns new problem set and writes it into the assigment xml for (int i = 0; i < EndUserList.Count; i++) { try { if (ddlAdminSelects.SelectedItem.ToString() == EndUserList[i].ScreenName) { if (EndUserList[i].UserType == UserType.Student) { AddNewProblemSet NewSet = new AddNewProblemSet(EndUserList[i]); NewSet.ShowDialog(); } } } catch (NullReferenceException x) { //do nothig } } }