From f5657459f6140aeded7a77bd85af492e3c6cdb13 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Tue, 2 Feb 2021 00:20:04 -0800 Subject: nil pointer replies --- OutboxPost.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OutboxPost.go') diff --git a/OutboxPost.go b/OutboxPost.go index a51d509..c5d5f2a 100644 --- a/OutboxPost.go +++ b/OutboxPost.go @@ -566,9 +566,11 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { for _, e := range activity.To { actor := GetActorFromDB(db, e) if actor.Id != "" { - for _, e := range activity.Object.Replies.OrderedItems { - TombstoneObjectFromCache(db, e.Id) - DeleteObject(db, e.Id) + if activity.Object.Replies != nil { + for _, k := range activity.Object.Replies.OrderedItems { + TombstoneObjectFromCache(db, k.Id) + DeleteObject(db, k.Id) + } } TombstoneObjectFromCache(db, activity.Object.Id) break @@ -587,6 +589,7 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { fmt.Println("follow request for rejected") response := RejectActivity(activity) MakeActivityRequest(db, response) + return } } break @@ -597,7 +600,8 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { SetActorFollowingDB(db, activity) } break - } + } + } func MakeActivityFollowingReq(w http.ResponseWriter, r *http.Request, activity Activity) bool { -- cgit v1.2.3