* object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
svn path=/trunk/mono/; revision=142917
2009-09-29 Zoltan Varga <vargaz@gmail.com>
+ * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
+
* threads.c (build_wait_tids): Fix a crash if there is no main thread, like
when using --compile-all.
g_assert (field);
if (exc->vtable->klass != mono_defaults.threadabortexception_class) {
- gboolean abort_process = (mono_thread_internal_current () == main_thread->internal_thread) ||
+ gboolean abort_process = (main_thread && (mono_thread_internal_current () == main_thread->internal_thread)) ||
(mono_runtime_unhandled_exception_policy_get () == MONO_UNHANDLED_POLICY_CURRENT);
root_appdomain_delegate = *(MonoObject **)(((char *)root_domain->domain) + field->offset);
if (current_domain != root_domain && (mono_framework_version () >= 2)) {