aboutsummaryrefslogtreecommitdiff
path: root/OutboxPost.go
diff options
context:
space:
mode:
authorFChannel <=>2021-02-02 00:20:04 -0800
committerFChannel <=>2021-02-02 00:20:04 -0800
commitf5657459f6140aeded7a77bd85af492e3c6cdb13 (patch)
tree7ddbcb062021f3cc32802781990fa9007244fd00 /OutboxPost.go
parent7df3590fe3cabd7372a739f7f70057c5d9185c23 (diff)
nil pointer replies
Diffstat (limited to 'OutboxPost.go')
-rw-r--r--OutboxPost.go12
1 files changed, 8 insertions, 4 deletions
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 {