Make sure endpoints["sharedInbox"] exists before using it

master
Michael Demetriou 2019-10-14 12:01:07 +03:00
parent 3a81f7784d
commit 6ca250bcf4
1 changed files with 3 additions and 1 deletions

View File

@ -34,7 +34,9 @@ func NewRemoteActor(iri string) (RemoteActor, error) {
var sharedInbox string
if info["endpoints"] != nil {
endpoints = info["endpoints"].(map[string]interface{})
sharedInbox = endpoints["sharedInbox"].(string)
if val, ok := endpoints["sharedInbox"]; ok {
sharedInbox = val.(string)
}
}
return RemoteActor{