check if http request was successful before working with response
Merge pull request #3 from aaemnnosttv/bug/get-ip-response-error

Avoid fatal error when resolving public IP address