From 5927b43c0fc74e66cd3a882b565ea70236559c02 Mon Sep 17 00:00:00 2001 From: unarist Date: Wed, 23 Aug 2017 03:00:49 +0900 Subject: Ignore empty response in ActivityPub::FetchRemoteStatusService (#4661) * Ignore empty response in ActivityPub::FetchRemoteStatusService This fixes `NoMethodError: undefined method `[]' for nil:NilClass` error. * Check json.nil? in JsonLdHelper#supported_context? --- app/helpers/jsonld_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/helpers/jsonld_helper.rb') diff --git a/app/helpers/jsonld_helper.rb b/app/helpers/jsonld_helper.rb index d8b3ddf18..8355eb055 100644 --- a/app/helpers/jsonld_helper.rb +++ b/app/helpers/jsonld_helper.rb @@ -14,7 +14,7 @@ module JsonLdHelper 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) -- cgit