diff options
author | cmrd Senya <senya@riseup.net> | 2019-05-05 10:54:42 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2021-09-18 05:44:19 +0300 |
commit | 1ec031475260d513661620ac52b799cffc3f544e (patch) | |
tree | b4c923dd8226fe205663b4c320bb2a3b88973541 /lib | |
parent | 413926b56e12a7f383909c2228b2a66176119899 (diff) |
Fix reshare import when root is not fetchable
Diffstat (limited to 'lib')
-rw-r--r-- | lib/archive_importer/entity_importer.rb | 2 | ||||
-rw-r--r-- | lib/archive_importer/own_entity_importer.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/archive_importer/entity_importer.rb b/lib/archive_importer/entity_importer.rb index 9ed4d04f9..a005f22eb 100644 --- a/lib/archive_importer/entity_importer.rb +++ b/lib/archive_importer/entity_importer.rb @@ -15,8 +15,10 @@ class ArchiveImporter rescue DiasporaFederation::Entities::Signable::SignatureVerificationFailed, DiasporaFederation::Discovery::InvalidDocument, DiasporaFederation::Discovery::DiscoveryError, + DiasporaFederation::Federation::Fetcher::NotFetchable, ActiveRecord::RecordInvalid => e logger.warn "#{self}: #{e}" + self.persisted_object = nil end attr_reader :json diff --git a/lib/archive_importer/own_entity_importer.rb b/lib/archive_importer/own_entity_importer.rb index 2d585c0cd..736115f63 100644 --- a/lib/archive_importer/own_entity_importer.rb +++ b/lib/archive_importer/own_entity_importer.rb @@ -21,7 +21,9 @@ class ArchiveImporter attr_reader :old_author_id def persisted_object - @persisted_object ||= (instance if real_author == old_author_id) + return @persisted_object if defined?(@persisted_object) + + @persisted_object = (instance if real_author == old_author_id) end def real_author |