Prevent NULL pointer dereference in http client callback