Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/solid_errors/occurrence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Occurrence < Record
def parsed_backtrace
return @parsed_backtrace if defined? @parsed_backtrace

@parsed_backtrace = parse_backtrace(backtrace.split("\n"))
@parsed_backtrace = parse_backtrace(backtrace&.split("\n"))
end

private
Expand Down
9 changes: 9 additions & 0 deletions test/controllers/solid_errors/errors_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ class SolidErrors::ErrorsControllerTest < ActionDispatch::IntegrationTest
inline_tags.each { |tag| assert_equal nonce, tag["nonce"], tag.to_html[0, 40] }
end

test "an occurrence reported without a backtrace still renders" do
# Rails 7 reports exceptions that were never raised without a backtrace
@error.occurrences.update_all(backtrace: nil)

get solid_errors.error_path(@error)

assert_response :success
end

private

def report_errors(count)
Expand Down
Loading