There seems to be no element in cmbLocation. If no item is selected, the SelectedItem property will be NULL, and you cannot call toString on null.
cmbLocation cmbPayment? cmbPayment.
- null:
private void cmbPayment_SelectedIndexChanged(object sender, EventArgs e)
{
if(!cmbPayment.SelectedItem == null)
{
string pm = cmbLocation.SelectedItem.ToString();
payment(pm);
}
}
, NullPointerExceptions.