* Ignore empty response in ActivityPub::FetchRemoteStatusService
This fixes `NoMethodError: undefined method `[]' for nil:NilClass` error.
* Check json.nil? in JsonLdHelper#supported_context?
end
def supported_context?(json)
- equals_or_includes?(json['@context'], ActivityPub::TagManager::CONTEXT)
+ !json.nil? && equals_or_includes?(json['@context'], ActivityPub::TagManager::CONTEXT)
end
def fetch_resource(uri)
def supported_activity?(body)
json = body_to_json(body)
- return false if json.nil? || !supported_context?(json)
+ return false unless supported_context?(json)
json['type'] == 'Person' ? json['inbox'].present? : true
end
end