]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error when fetching followers/following from REST API when user has network hidde...
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 30 Dec 2019 23:54:38 +0000 (00:54 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Dec 2019 23:54:38 +0000 (00:54 +0100)
Fix #12510

app/controllers/api/v1/accounts/follower_accounts_controller.rb
app/controllers/api/v1/accounts/following_accounts_controller.rb

index 2dabb8398c13165effa3cec8194ba138cfd2b50a..950e9acf0e125f09e2c1c3ccca54d588cb20be86 100644 (file)
@@ -25,7 +25,7 @@ class Api::V1::Accounts::FollowerAccountsController < Api::BaseController
   end
 
   def hide_results?
-    (@account.user_hides_network? && current_account.id != @account.id) || (current_account && @account.blocking?(current_account))
+    (@account.user_hides_network? && current_account&.id != @account.id) || (current_account && @account.blocking?(current_account))
   end
 
   def default_accounts
index 44e89804b377e40a470182cb3ba2038d1050362b..b1433af5e41d94d04ff0ef04ab53fd3e6c9bfa96 100644 (file)
@@ -25,7 +25,7 @@ class Api::V1::Accounts::FollowingAccountsController < Api::BaseController
   end
 
   def hide_results?
-    (@account.user_hides_network? && current_account.id != @account.id) || (current_account && @account.blocking?(current_account))
+    (@account.user_hides_network? && current_account&.id != @account.id) || (current_account && @account.blocking?(current_account))
   end
 
   def default_accounts