Merge pull request #2721 from ludovic-henry/fix-mono_ms_ticks
[mono.git] / mono / metadata / exception.c
index e2c45aca38bbc615c7547112df6253a7475560bb..e2e162f702a1efeb69e0226a5a4ab8eedb4d52d4 100644 (file)
@@ -9,6 +9,7 @@
  *
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <glib.h>
@@ -939,8 +940,10 @@ ves_icall_Mono_Runtime_GetNativeStackTrace (MonoException *exc)
 {
        char *trace;
        MonoString *res;
-       if (!exc)
-               mono_raise_exception (mono_get_exception_argument_null ("exception"));
+       if (!exc) {
+               mono_set_pending_exception (mono_get_exception_argument_null ("exception"));
+               return NULL;
+       }
 
        trace = mono_exception_get_native_backtrace (exc);
        res = mono_string_new (mono_domain_get (), trace);