From 42573b76f1ed4ec64a961441b14631c341b752b4 Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 23 Aug 2018 00:27:58 +0200 Subject: Do not crash if remote custom emoji does not define updated date (fixes #8376) (#8377) --- app/services/activitypub/process_account_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services') diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 7f95678b0..ac19bf933 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -226,7 +226,7 @@ class ActivityPub::ProcessAccountService < BaseService updated = tag['updated'] emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) - return unless emoji.nil? || emoji.updated_at >= updated + return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && emoji.updated_at >= updated) emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri) emoji.image_remote_url = image_url -- cgit