MailChimp.NET
MailChimp.NET copied to clipboard
Bug when unable to connect to server
ObjectNullReferenceException is thrown in MakeApiCall method in catch block when remote site is not available.
Problematic line is:
// Throw a new exception based on this information:
throw new MailChimpAPIException(apiError.Error, ex, apiError);
but apiError is null.
Problem can be easily reproduced when you turn on firewall for outbound connections, so the remote site will be inaccessible.
@ramoo Good call. Any suggestions?
i am not sure, if it is good idea:
// Throw a new exception based on this information:
if (apiError == null)
{
throw new MailChimpAPIException(ex.Message, ex, null);
}
else
{
throw new MailChimpAPIException(apiError.Error, ex, apiError);
}