]> cat aescling's git repositories - mastodon.git/commitdiff
Fix too late return
authorEugen <eugen@zeonfederated.com>
Sat, 14 Jan 2017 01:22:16 +0000 (02:22 +0100)
committerGitHub <noreply@github.com>
Sat, 14 Jan 2017 01:22:16 +0000 (02:22 +0100)
app/services/process_feed_service.rb

index f085fcd8e3a0f82147d6923428661085d4866093..cc35e65b8a18b83e7e31d8470c5c92a0039e7e71 100644 (file)
@@ -44,6 +44,8 @@ class ProcessFeedService < BaseService
       Rails.logger.debug "Creating remote status #{id}"
       status = status_from_xml(@xml)
 
+      return if status.nil?
+      
       if verb == :share
         original_status = status_from_xml(@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS))
         status.reblog   = original_status
@@ -56,8 +58,6 @@ class ProcessFeedService < BaseService
         end
       end
 
-      return if status.nil?
-
       status.save!
 
       NotifyService.new.call(status.reblog.account, status) if status.reblog? && status.reblog.account.local?