Fix panic in mobile GetPeersJSON

This commit is contained in:
Neil Alexander 2023-10-18 22:38:10 +01:00
parent bcd80b043f
commit aceb037c57
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -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