lib/rubocop/cop/style/guard_clause.rb in rubocop-1.41.0 vs lib/rubocop/cop/style/guard_clause.rb in rubocop-1.41.1
- old
+ new
@@ -187,10 +187,10 @@
if_branch = node.if_branch
else_branch = node.else_branch
if if_branch&.send_type? && heredoc?(if_branch.last_argument)
autocorrect_heredoc_argument(corrector, node, if_branch, else_branch, guard)
- elsif else_branch&.send_type? && else_branch.last_argument&.heredoc?
+ elsif else_branch&.send_type? && heredoc?(else_branch.last_argument)
autocorrect_heredoc_argument(corrector, node, else_branch, if_branch, guard)
else
corrector.remove(node.loc.end)
return unless node.else?