1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Raise an error on getting activity uri for remote status (#4984)

We had returned `nil` for that case, but this raises an error instead, as a wrong usage of the method.
This method is currently only used in ActivitySerializer.
This commit is contained in:
unarist 2017-09-17 20:51:34 +09:00 committed by Eugen Rochko
parent 44245926f1
commit 3f07f1b2b1

View file

@ -37,7 +37,7 @@ class ActivityPub::TagManager
end end
def activity_uri_for(target) def activity_uri_for(target)
return nil unless %i(note comment activity).include?(target.object_type) && target.local? raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
activity_account_status_url(target.account, target) activity_account_status_url(target.account, target)
end end