From f8dbb78412bc0a15edb5685069161d103e31071c Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Fri, 13 Nov 2020 23:39:42 +0100 Subject: [PATCH] Fix stupid mistake --- activityPub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activityPub.go b/activityPub.go index bc27509..8fadd74 100644 --- a/activityPub.go +++ b/activityPub.go @@ -148,7 +148,7 @@ func apHandleInbox(w http.ResponseWriter, r *http.Request) { createWebmention(id, inReplyTo) } else if content, hasContent := object["content"].(string); hasContent && hasID && len(id) > 0 { // May be a mention; find links to blog and save them as webmentions - if doc, err := webmention.DocumentFromReader(r.Context(), strings.NewReader(content), id); err != nil { + if doc, err := webmention.DocumentFromReader(context.Background(), strings.NewReader(content), id); err == nil && doc != nil { for _, link := range doc.ExternalLinks() { if strings.Contains(link, blogIri) { createWebmention(id, link)