From 4ff44be1348136fa602318cca343e716fea0e556 Mon Sep 17 00:00:00 2001
From: Nick Schonning <nschonni@gmail.com>
Date: Tue, 21 Feb 2023 19:57:56 -0500
Subject: [PATCH] Autofix Rubocop Rails/Blank (#23765)

---
 .rubocop_todo.yml                                      | 7 -------
 app/services/activitypub/fetch_remote_actor_service.rb | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bbf01bacf9..0bdf72084c 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1485,13 +1485,6 @@ Rails/ApplicationController:
     - 'app/controllers/well_known/nodeinfo_controller.rb'
     - 'app/controllers/well_known/webfinger_controller.rb'
 
-# Offense count: 1
-# This cop supports unsafe autocorrection (--autocorrect-all).
-# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
-Rails/Blank:
-  Exclude:
-    - 'app/services/activitypub/fetch_remote_actor_service.rb'
-
 # Offense count: 35
 # Configuration parameters: Database, Include.
 # SupportedDatabases: mysql, postgresql
diff --git a/app/services/activitypub/fetch_remote_actor_service.rb b/app/services/activitypub/fetch_remote_actor_service.rb
index ee0eaff08b..c295700860 100644
--- a/app/services/activitypub/fetch_remote_actor_service.rb
+++ b/app/services/activitypub/fetch_remote_actor_service.rb
@@ -28,7 +28,7 @@ class ActivityPub::FetchRemoteActorService < BaseService
     raise Error, "Unsupported JSON-LD context for document #{uri}" unless supported_context?
     raise Error, "Unexpected object type for actor #{uri} (expected any of: #{SUPPORTED_TYPES})" unless expected_type?
     raise Error, "Actor #{uri} has moved to #{@json['movedTo']}" if break_on_redirect && @json['movedTo'].present?
-    raise Error, "Actor #{uri} has no 'preferredUsername', which is a requirement for Mastodon compatibility" unless @json['preferredUsername'].present?
+    raise Error, "Actor #{uri} has no 'preferredUsername', which is a requirement for Mastodon compatibility" if @json['preferredUsername'].blank?
 
     @uri      = @json['id']
     @username = @json['preferredUsername']
-- 
GitLab