mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-09 23:20:26 +03:00
Fix panic in mobile GetPeersJSON
This commit is contained in:
parent
bcd80b043f
commit
aceb037c57
@ -208,8 +208,11 @@ func (m *Yggdrasil) GetPeersJSON() (result string) {
|
|||||||
IP string
|
IP string
|
||||||
}{}
|
}{}
|
||||||
for _, v := range m.core.GetPeers() {
|
for _, v := range m.core.GetPeers() {
|
||||||
a := address.AddrForKey(v.Key)
|
var ip string
|
||||||
ip := net.IP(a[:]).String()
|
if v.Key != nil {
|
||||||
|
a := address.AddrForKey(v.Key)
|
||||||
|
ip = net.IP(a[:]).String()
|
||||||
|
}
|
||||||
peers = append(peers, struct {
|
peers = append(peers, struct {
|
||||||
core.PeerInfo
|
core.PeerInfo
|
||||||
IP string
|
IP string
|
||||||
|
Loading…
Reference in New Issue
Block a user