Prevent nil pointer panic from ActivityObject() method

Previously, we might potentially return a nil activitystreams.Object,
which would crash the app. This fixes that.
This commit is contained in:
Matt Baer 2020-03-17 13:13:05 -04:00
parent 06054a2cd7
commit a9bed9fea9
1 changed files with 1 additions and 1 deletions

View File

@ -1182,7 +1182,7 @@ func (p *PublicPost) ActivityObject(app *App) *activitystreams.Object {
actorIRI, err := app.db.GetProfilePageFromHandle(app, handle) actorIRI, err := app.db.GetProfilePageFromHandle(app, handle)
if err != nil { if err != nil {
log.Info("Can't find this user either in the database nor in the remote instance") log.Info("Can't find this user either in the database nor in the remote instance")
return nil continue
} }
mentionedUsers[handle] = actorIRI mentionedUsers[handle] = actorIRI
} }