From 3a9e18e5405b5772be88bfc45739d6a350560111 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Mon, 26 Sep 2016 16:07:48 -0400 Subject: [PATCH] [MonoError] Don't overwrite computed TypeLoadException message with empty string Fixes [#44729](https://bugzilla.xamarin.com/show_bug.cgi?id=44729). --- mono/metadata/icall.c | 2 +- mono/utils/mono-error.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 27bafb33291..bab8c6235f0 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -1420,7 +1420,7 @@ ves_icall_System_Type_internal_from_name (MonoString *name, if (type == NULL){ if (throwOnError) { - mono_error_set_type_load_name (&error, g_strdup (str), NULL, ""); + mono_error_set_type_load_name (&error, g_strdup (str), g_strdup (""), ""); goto leave; } } diff --git a/mono/utils/mono-error.c b/mono/utils/mono-error.c index 7e186b6b717..5ef98e1e9ef 100644 --- a/mono/utils/mono-error.c +++ b/mono/utils/mono-error.c @@ -618,7 +618,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out) } exception = mono_exception_from_name_two_strings_checked (mono_get_corlib (), "System", "TypeLoadException", type_name, assembly_name, error_out); - if (exception) + if (exception && error->full_message != NULL && strcmp (error->full_message, "")) set_message_on_exception (exception, error, error_out); } else { exception = mono_exception_from_name_msg (mono_defaults.corlib, "System", "TypeLoadException", error->full_message); -- 2.25.1