summaryrefslogtreecommitdiff
path: root/Source/Core/WinUpdater/WinUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/WinUpdater/WinUI.cpp')
-rw-r--r--Source/Core/WinUpdater/WinUI.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/WinUpdater/WinUI.cpp b/Source/Core/WinUpdater/WinUI.cpp
index d65b00033d..97f2da459b 100644
--- a/Source/Core/WinUpdater/WinUI.cpp
+++ b/Source/Core/WinUpdater/WinUI.cpp
@@ -251,8 +251,11 @@ void Sleep(int sleep)
void WaitForPID(u32 pid)
{
HANDLE parent_handle = OpenProcess(SYNCHRONIZE, FALSE, static_cast<DWORD>(pid));
- WaitForSingleObject(parent_handle, INFINITE);
- CloseHandle(parent_handle);
+ if (parent_handle)
+ {
+ WaitForSingleObject(parent_handle, INFINITE);
+ CloseHandle(parent_handle);
+ }
}
void SetVisible(bool visible)