Open derekantrican opened 4 years ago
Looks like this might be communicating incorrectly with the Namecheap API. After copying some of the code from the repo and debugging into it, this is the response coming back from Namecheap:
<ApiResponse Status="ERROR" xmlns="http://api.namecheap.com/xml.response">
<Errors>
<Error Number="5050900">Object reference not set to an instance of an object.</Error>
</Errors>
<Warnings />
<RequestedCommand>namecheap.domains.dns.sethosts</RequestedCommand>
<CommandResponse Type="namecheap.domains.dns.setHosts" />
<Server>PHX01APIEXT01</Server>
<GMTTimeDifference>--5:00</GMTTimeDifference>
<ExecutionTime>0.021</ExecutionTime>
</ApiResponse>
I have found the issue. One of my records was a URL redirect record which contained a "#" in the url (eg https://docs.google.com/spreadsheets/d/1BNaPNSkiD7bLXdpntabeWcdnZ7Vg5jMi3eUsEwBBKvc/edit#gid=1158913528). To solve this, I needed to URL Encode the parameter.
I would suggest that this be added to the Query.Execute()
method. For example:
foreach (KeyValuePair<string, string> param in _parameters)
url.Append("&").Append(param.Key).Append("=").Append(HttpUtility.UrlEncode(param.Value));
The following code throws an exception:
Exception details:
Message:
Object reference not set to an instance of an object
StackTrace: