diff --git a/lib/better_errors/error_page.rb b/lib/better_errors/error_page.rb index afb28f0d..07e470db 100644 --- a/lib/better_errors/error_page.rb +++ b/lib/better_errors/error_page.rb @@ -78,7 +78,7 @@ def exception_type end def exception_message - exception.message.strip.gsub(/(\r?\n\s*\r?\n)+/, "\n") + exception.message&.strip&.gsub(/(\r?\n\s*\r?\n)+/, "\n") end def exception_hint