Skip to content

Commit

Permalink
Fix panic in mobile GetPeersJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Oct 18, 2023
1 parent bcd80b0 commit aceb037
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contrib/mobile/mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aceb037

Please sign in to comment.