Skip to content

Commit

Permalink
Early return when location is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Apr 29, 2023
1 parent b829026 commit c7ed3b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rbs/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module DetailedMessageable
def detailed_message(highlight: false, **)
msg = super

return msg unless location

# Support only one line
return msg unless location.start_line == location.end_line

Expand Down

0 comments on commit c7ed3b7

Please sign in to comment.