about summary refs log tree commit diff
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-09-17 20:51:34 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-17 13:51:34 +0200
commit3f07f1b2b18affd0c48f3673d124cfbea6b9e380 (patch)
tree904fe193da76b5f4dea451d691794822a7ea840d
parent44245926f105e653cfe4fd3397b796df345023b5 (diff)
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.
-rw-r--r--app/lib/activitypub/tag_manager.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb
index 929e87852..1b4e271db 100644
--- a/app/lib/activitypub/tag_manager.rb
+++ b/app/lib/activitypub/tag_manager.rb
@@ -37,7 +37,7 @@ class ActivityPub::TagManager
   end
 
   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)
   end