Skip to content

Commit a9346f1

Browse files
committed
fix crash with RuboCop >= 1.41.0 when there are no corrections
rubocop/rubocop#11264 did optimisations to not set RuboCop::Cop::Base::InvestigationReport#corrector when there are no corrections.
1 parent 6e1703c commit a9346f1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/pronto/rubocop/offense_line.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def message_text
3434
def suggestion_text
3535
return unless patch_cop.runner.pronto_rubocop_config['suggestions']
3636
return if corrections_count.zero?
37+
return if corrector.nil? # possible after optimisation in https://github.com/rubocop/rubocop/pull/11264
3738
return if differing_lines_count != corrections_count
3839

3940
@suggestion_text ||= corrected_lines[offense.line - 1]

0 commit comments

Comments
 (0)