diff --git a/sentry-ruby/lib/sentry/interfaces/single_exception.rb b/sentry-ruby/lib/sentry/interfaces/single_exception.rb index 6a3ac6e0a..5e18ba226 100644 --- a/sentry-ruby/lib/sentry/interfaces/single_exception.rb +++ b/sentry-ruby/lib/sentry/interfaces/single_exception.rb @@ -15,7 +15,7 @@ class SingleExceptionInterface < Interface def initialize(exception:, stacktrace: nil) @type = exception.class.to_s - @value = (exception.message || "").byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES) + @value = (exception.message || "")&.byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES)&.to_s @module = exception.class.to_s.split('::')[0...-1].join('::') @thread_id = Thread.current.object_id @stacktrace = stacktrace