From f8c7f3bdf590c01c8d95274f0be017fc0f94295c Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Thu, 28 Jan 2016 18:20:46 -0500 Subject: [PATCH] [reflection] Don't raise in mono_type_get_object_checked --- mono/metadata/reflection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index d037c22fe00..a7c87ff9ef9 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -6875,7 +6875,8 @@ mono_type_get_object_checked (MonoDomain *domain, MonoType *type, MonoError *err if (!verify_safe_for_managed_space (type)) { mono_domain_unlock (domain); mono_loader_unlock (); - mono_raise_exception (mono_get_exception_invalid_operation ("This type cannot be propagated to managed space")); + mono_error_set_generic_error (error, "System", "InvalidOperationException", "This type cannot be propagated to managed space"); + return NULL; } if (mono_class_get_ref_info (klass) && !klass->wastypebuilder) { -- 2.11.4.GIT