server: Make sure that last error doesn't get set during thread cleanup.
diff --git a/server/hook.c b/server/hook.c
index f5ebc2b..7b889d8 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -114,9 +114,10 @@
static struct hook_table *get_global_hooks( struct thread *thread )
{
struct hook_table *table;
- struct desktop *desktop = get_thread_desktop( thread, 0 );
+ struct desktop *desktop;
- if (!desktop) return NULL;
+ if (!thread->desktop) return NULL;
+ if (!(desktop = get_thread_desktop( thread, 0 ))) return NULL;
table = desktop->global_hooks;
release_object( desktop );
return table;