Skip to content

Commit

Permalink
fixes uncaught ActiveRecord::StatementInvalid exception in Mastodon::…
Browse files Browse the repository at this point in the history
…AccountsCLI#approve
  • Loading branch information
danielmbrasil committed Apr 19, 2023
1 parent 4db8230 commit aef51ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mastodon/accounts_cli.rb
Expand Up @@ -543,7 +543,7 @@ def approve(username = nil)
if options[:all]
User.pending.find_each(&:approve!)
say('OK', :green)
elsif options[:number]
elsif options[:number]&.positive?
User.pending.limit(options[:number]).each(&:approve!)
say('OK', :green)
elsif username.present?
Expand All @@ -557,6 +557,7 @@ def approve(username = nil)
account.user&.approve!
say('OK', :green)
else
say('Number must be positive', :red) if options[:number]
exit(1)
end
end
Expand Down

0 comments on commit aef51ff

Please sign in to comment.