mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-02-04 20:05:05 +00:00
[bugfix] Don't panic on delivery of Activity with no object
(#3730)
This commit is contained in:
parent
acd3e80ae1
commit
053d820845
|
@ -116,8 +116,10 @@ func (f *Federator) PostInboxRequestBodyHook(ctx context.Context, r *http.Reques
|
||||||
otherIRIs = append(otherIRIs, ap.ExtractCcURIs(addressable)...)
|
otherIRIs = append(otherIRIs, ap.ExtractCcURIs(addressable)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now perform the same checks, but for the Object(s) of the Activity.
|
// Now perform the same checks, but
|
||||||
|
// for any Object(s) of the Activity.
|
||||||
objectProp := activity.GetActivityStreamsObject()
|
objectProp := activity.GetActivityStreamsObject()
|
||||||
|
if objectProp != nil {
|
||||||
for iter := objectProp.Begin(); iter != objectProp.End(); iter = iter.Next() {
|
for iter := objectProp.Begin(); iter != objectProp.End(); iter = iter.Next() {
|
||||||
if iter.IsIRI() {
|
if iter.IsIRI() {
|
||||||
otherIRIs = append(otherIRIs, iter.GetIRI())
|
otherIRIs = append(otherIRIs, iter.GetIRI())
|
||||||
|
@ -145,6 +147,7 @@ func (f *Federator) PostInboxRequestBodyHook(ctx context.Context, r *http.Reques
|
||||||
otherIRIs = append(otherIRIs, ap.ExtractCcURIs(addressable)...)
|
otherIRIs = append(otherIRIs, ap.ExtractCcURIs(addressable)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clean any instances of the public URI, since
|
// Clean any instances of the public URI, since
|
||||||
// we don't care about that in this context.
|
// we don't care about that in this context.
|
||||||
|
|
Loading…
Reference in a new issue