From db21a6c5ee2586cf483193e0e6d606629140546a Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 7 Mar 2019 01:50:37 +0100 Subject: [PATCH] Avoid unnecessarily fetching the replies collection when it is empty (#10201) --- app/lib/activitypub/activity/create.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 07ef16bf3f..87179030c2 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -253,7 +253,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity collection = @object['replies'] return if collection.nil? replies = ActivityPub::FetchRepliesService.new.call(status, collection, false) - return if replies.present? + return unless replies.nil? uri = value_or_id(collection) ActivityPub::FetchRepliesWorker.perform_async(status.id, uri) unless uri.nil? end