gmag11/NtpClient

Failed DNS lookup leads to exception in ' void NTPClient::s_dnsFound '

lab-mathias-claussen opened this issue · 1 comments

Form the master branch in the Function 'void NTPClient::s_dnsFound' the argument for the call to dnsFound can be NULL (const ip_addr_t *ipaddr ) and will fail with the Function IPAddress and produce a exception.

This happens with the ESP8266 Arduino Board Pakage 2.5.2 using the code from the master branch.
As workarround the following lines were added in the beginning of "getIPClass "

#if NETWORK_TYPE == NETWORK_ESP8266
IPAddress getIPClass (const ip_addr_t *ipaddr) {

IPAddress ip;
if(ipaddr==NULL){
     ip = IPAddress( 0,0,0,0 );
     return ip;
}

....

This is a quite ugly fix and don't resolves the problem only handles it.

Best Regards

CalM

Thanks. This has been solved on 2ab1e8c
Please, test it if you like