From aceb037c577afb49d06608c21777a93a63e39936 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 18 Oct 2023 22:38:10 +0100 Subject: [PATCH] Fix panic in mobile `GetPeersJSON` --- contrib/mobile/mobile.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/mobile/mobile.go b/contrib/mobile/mobile.go index eb79430..018fd1a 100644 --- a/contrib/mobile/mobile.go +++ b/contrib/mobile/mobile.go @@ -208,8 +208,11 @@ func (m *Yggdrasil) GetPeersJSON() (result string) { IP string }{} for _, v := range m.core.GetPeers() { - a := address.AddrForKey(v.Key) - ip := net.IP(a[:]).String() + var ip string + if v.Key != nil { + a := address.AddrForKey(v.Key) + ip = net.IP(a[:]).String() + } peers = append(peers, struct { core.PeerInfo IP string