[runtime] Fix unhandled exception fatal error message. Fixes #43410 (#3404)
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Wed, 17 Aug 2016 19:33:03 +0000 (15:33 -0400)
committerGitHub <noreply@github.com>
Wed, 17 Aug 2016 19:33:03 +0000 (15:33 -0400)
Partially revert bcbd0ac0c018b0a68caa63ac1135052b2082f468

mono/metadata/exception.c

index e9ebcf38d384ca945bae7903c53e1658fee3691e..09b498ab559bdeabe7fa97e88f6c76634f203809 100644 (file)
@@ -1076,10 +1076,10 @@ mono_invoke_unhandled_exception_hook (MonoObject *exc)
                
                if (str && is_ok (&inner_error)) {
                        msg = mono_string_to_utf8_checked (str, &inner_error);
-               }
-               if (!is_ok (&inner_error)) {
-                       msg = g_strdup_printf ("Nested exception while formatting original exception");
-                       mono_error_cleanup (&inner_error);
+                       if (!is_ok (&inner_error)) {
+                               msg = g_strdup_printf ("Nested exception while formatting original exception");
+                               mono_error_cleanup (&inner_error);
+                       }
                } else if (other) {
                        char *original_backtrace = mono_exception_get_managed_backtrace ((MonoException*)exc);
                        char *nested_backtrace = mono_exception_get_managed_backtrace ((MonoException*)other);