From 046bee34d3b19c046dba59c1d6cb08548f978859 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 5 Nov 2017 12:05:25 +0100 Subject: Fix bug when no posts are in the db. --- lib/pleroma/web/activity_pub/activity_pub.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 71e52cb46..d4eb50323 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -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 -- cgit v1.2.3