Identity Messageservers count errors
This commit is contained in:
parent
8bde6802de
commit
3066d48b3e
@ -42,7 +42,12 @@ func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerI
|
|||||||
peer.Name = ContactName
|
peer.Name = ContactName
|
||||||
peer.InvitationId = uuid.New().String()
|
peer.InvitationId = uuid.New().String()
|
||||||
if id.MessageServers.Servers == nil {
|
if id.MessageServers.Servers == nil {
|
||||||
return nil, errors.New("no servers defined in your identity")
|
return nil, errors.New("no message servers defined in your identity")
|
||||||
|
}
|
||||||
|
for _, i := range MessageServerIdxs {
|
||||||
|
if i > len(id.MessageServers.Servers)-1 {
|
||||||
|
return nil, errors.New("requested server out of range of defined message servers")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, i := range MessageServerIdxs {
|
for _, i := range MessageServerIdxs {
|
||||||
srv := id.MessageServers.Servers[i].ServerData
|
srv := id.MessageServers.Servers[i].ServerData
|
||||||
|
Loading…
Reference in New Issue
Block a user