From cdb50edabceb43570b9845b224d82d26ec5b154d Mon Sep 17 00:00:00 2001 From: Thorsten Claus Date: Sat, 17 Jul 2021 17:39:20 +0200 Subject: [PATCH] Person.find_or_fetch_by_identifier never return nil Person.find_or_fetch_by_identifier raises an exception if person is not found localy and not fetchable. It never returns nil. These code changes take care about this behaviour and changes specs and code to behave equally. Close #8273 --- lib/archive_validator/author_private_key_validator.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/archive_validator/author_private_key_validator.rb b/lib/archive_validator/author_private_key_validator.rb index a751f1afd..7a4c747e3 100644 --- a/lib/archive_validator/author_private_key_validator.rb +++ b/lib/archive_validator/author_private_key_validator.rb @@ -5,12 +5,11 @@ class ArchiveValidator include Diaspora::Logging def validate - return if person.nil? return if person.public_key.export == private_key.public_key.export messages.push("Private key in the archive doesn't match the known key of #{person.diaspora_handle}") rescue DiasporaFederation::Discovery::DiscoveryError - logger.info "#{self}: Archive author couldn't be fetched (old home pod is down?), will continue with data"\ + logger.info "Archive author couldn't be fetched (old home pod is down?), will continue with data"\ " import only" end end