I am trying to run some code and everytime I run this particular section I get an error:
if (member.Status == "subscribed")
{
EmailParameter email = new EmailParameter()
{
Email = obj.EmailAddr
};
UnsubscribeResult result = mc.Unsubscribe("d97cdac320", email);
}
Here is the error message:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 605: var member = info.Data.SingleOrDefault();
Line 606:
Line 607: if (member.Status == "subscribed")
Line 608: {
Line 609: EmailParameter email = new EmailParameter()
Any ideas on how to correct this and have some background into this error?