From a9bed9fea9fa90f95309738acd3b60f45d860fa4 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 17 Mar 2020 13:13:05 -0400 Subject: [PATCH] Prevent nil pointer panic from ActivityObject() method Previously, we might potentially return a nil activitystreams.Object, which would crash the app. This fixes that. --- posts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts.go b/posts.go index 35e9bd3..5d9b9f8 100644 --- a/posts.go +++ b/posts.go @@ -1182,7 +1182,7 @@ func (p *PublicPost) ActivityObject(app *App) *activitystreams.Object { actorIRI, err := app.db.GetProfilePageFromHandle(app, handle) if err != nil { log.Info("Can't find this user either in the database nor in the remote instance") - return nil + continue } mentionedUsers[handle] = actorIRI }