Fix bug when no posts are in the db.

This commit is contained in:
Roger Braun 2017-11-05 12:05:25 +01:00
commit 046bee34d3
2 changed files with 3 additions and 1 deletions

View file

@ -157,7 +157,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
# Only search through last 100_000 activities by default
defp restrict_recent(query, _) do
since = Repo.aggregate(Activity, :max, :id) - 100_000
since = (Repo.aggregate(Activity, :max, :id) || 0) - 100_000
from activity in query,
where: activity.id > ^since