Fix forwarder being called with `nil` status when quote post is soft-deleted (#36463)

pull/36476/head
Claire 3 weeks ago committed by GitHub
parent fd516347cb
commit 50743cc35b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -59,9 +59,11 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
@quote = Quote.find_by(approval_uri: object_uri, quoted_account: @account)
return if @quote.nil?
ActivityPub::Forwarder.new(@account, @json, @quote.status).forward!
ActivityPub::Forwarder.new(@account, @json, @quote.status).forward! if @quote.status.present?
@quote.reject!
DistributionWorker.perform_async(@quote.status_id, { 'update' => true })
DistributionWorker.perform_async(@quote.status_id, { 'update' => true }) if @quote.status.present?
end
def forwarder

Loading…
Cancel
Save