diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c index 9758197d4b069..c29345098d8bf 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.c +++ b/src/mono/mono/eventpipe/ep-rt-mono.c @@ -3479,10 +3479,14 @@ ep_rt_mono_write_event_exception_thrown (MonoObject *obj) flags |= EXCEPTION_THROWN_FLAGS_IS_CLS_COMPLIANT; if (exception->inner_ex) flags |= EXCEPTION_THROWN_FLAGS_HAS_INNER; - exception_message = ep_rt_utf16_to_utf8_string (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message)); + if (exception->message) + exception_message = ep_rt_utf16_to_utf8_string (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message)); hresult = exception->hresult; } + if (exception_message == NULL) + exception_message = g_strdup (""); + if (mono_get_eh_callbacks ()->mono_walk_stack_with_ctx) mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (get_exception_ip_func, NULL, MONO_UNWIND_SIGNAL_SAFE, (void *)&ip);