lib/lookbook/error.rb in lookbook-1.4.5 vs lib/lookbook/error.rb in lookbook-1.5.0
- old
+ new
@@ -78,10 +78,10 @@
path = if @file_path.nil?
parsed_backtrace[0][0] if parsed_backtrace.any?
else
@file_path.presence || nil
end
- path.nil? ? nil : path.to_s.delete_prefix("#{Rails.root}/")
+ path&.to_s&.delete_prefix("#{Rails.root}/")
end
def line_number
number = if @line_number.nil?
parsed_backtrace[0][1] if parsed_backtrace.any?