From 25d8110ed2fbf4938b6c835392a47ae5bbde4ba4 Mon Sep 17 00:00:00 2001 From: "syed.amer@gilani.eu" Date: Wed, 24 Feb 2010 14:37:41 +0000 Subject: [PATCH] check for NULL when attaching to foreground window Should fix Issue #66 thanks to joerg.bornemann for the patch --- lib/platform/CSynergyHook.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/platform/CSynergyHook.cpp b/lib/platform/CSynergyHook.cpp index c77ea546..1905be5f 100644 --- a/lib/platform/CSynergyHook.cpp +++ b/lib/platform/CSynergyHook.cpp @@ -156,6 +156,9 @@ attachThreadToForeground() // already in the right thread. if (g_hookThread != 0) { HWND window = GetForegroundWindow(); + if (window == NULL) + return false; + DWORD threadID = GetWindowThreadProcessId(window, NULL); // skip if no change if (g_attachedThread != threadID) {