From 08bd3a63046603ce249f0aa0072aff2037a5bb45 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 20 Feb 2023 10:42:04 -0400 Subject: [PATCH] fix(c-bindings): check if ENR is nil --- mobile/api_discovery.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mobile/api_discovery.go b/mobile/api_discovery.go index 72d35d15..520fc120 100644 --- a/mobile/api_discovery.go +++ b/mobile/api_discovery.go @@ -43,7 +43,11 @@ func DnsDiscovery(url string, nameserver string, ms int) string { for _, addr := range n.Addresses { item.Addresses = append(item.Addresses, addr.String()) } - item.ENR = n.ENR.String() + + if n.ENR != nil { + item.ENR = n.ENR.String() + } + response = append(response, item) }