]> cat aescling's git repositories - mastodon.git/commitdiff
Fix tootctl ip_blocks add failing if not given a comment (#15263)
authorThibG <thib@sitedethib.com>
Wed, 2 Dec 2020 20:19:41 +0000 (21:19 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Dec 2020 20:19:41 +0000 (21:19 +0100)
Fixes #15261

lib/mastodon/ip_blocks_cli.rb

index 6aff36d90886dbc94509f9364a67c7d54374dab7..5c38c1aca07c91331874d19f9be7dcc934d7029a 100644 (file)
@@ -47,7 +47,7 @@ module Mastodon
         ip_block ||= IpBlock.new(ip: address)
 
         ip_block.severity   = options[:severity]
-        ip_block.comment    = options[:comment]
+        ip_block.comment    = options[:comment] if options[:comment].present?
         ip_block.expires_in = options[:duration]
 
         if ip_block.save