From a00dfeecf0a7742366a32081d837fec1ebcead14 Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 24 Jun 2019 20:55:52 +0200 Subject: [PATCH] WinUpdater: Properly account for failure in WaitForPID --- Source/Core/WinUpdater/WinUI.cpp | 7 +++++-- 1 file 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(pid)); - WaitForSingleObject(parent_handle, INFINITE); - CloseHandle(parent_handle); + if (parent_handle) + { + WaitForSingleObject(parent_handle, INFINITE); + CloseHandle(parent_handle); + } } void SetVisible(bool visible)