Check if Create object is Note to prevent panic
This commit is contained in:
parent
359be39430
commit
508a848616
|
@ -131,6 +131,7 @@ func PersonInbox(ctx *context.APIContext) {
|
|||
// Unfollowing a user
|
||||
err = unfollow(ctx, activity)
|
||||
case ap.CreateType:
|
||||
if activity.Object.GetType() == ap.NoteType {
|
||||
// TODO: this is kinda a hack
|
||||
err = ap.OnObject(activity.Object, func(n *ap.Note) error {
|
||||
noteIRI := n.InReplyTo.GetLink().String()
|
||||
|
@ -138,6 +139,7 @@ func PersonInbox(ctx *context.APIContext) {
|
|||
n.Context = ap.IRI(strings.TrimSuffix(noteIRI, "/"+noteIRISplit[len(noteIRISplit)-1]))
|
||||
return createComment(ctx, n)
|
||||
})
|
||||
}
|
||||
case ap.DeleteType:
|
||||
// Deleting a user
|
||||
err = delete(ctx, activity)
|
||||
|
|
Reference in New Issue