Prevent nil pointer panic from ActivityObject() method

Previously, we might potentially return a nil activitystreams.Object,
which would crash the app. This fixes that.
pull/282/head
Matt Baer 5 years ago
parent 06054a2cd7
commit a9bed9fea9
  1. 2
      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
}

Loading…
Cancel
Save