From 6e4a0e9a11cbb811479a9b958adf8cb920eafd0b Mon Sep 17 00:00:00 2001
From: pineappleEA <pineaea@gmail.com>
Date: Thu, 10 Jun 2021 02:25:31 +0200
Subject: [PATCH] early-access version 1772

---
 README.md                   | 2 +-
 src/core/hle/kernel/svc.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 32e5c4335..60cca2766 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 yuzu emulator early access
 =============
 
-This is the source code for early-access 1771.
+This is the source code for early-access 1772.
 
 ## Legal Notice
 
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 28bcae6e7..8339e11a0 100755
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -449,8 +449,8 @@ static ResultCode CancelSynchronization(Core::System& system, Handle handle) {
 
     // Get the thread from its handle.
     KScopedAutoObject thread =
-        system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(
-            static_cast<Handle>(handle));
+        system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(handle);
+    R_UNLESS(thread.IsNotNull(), ResultInvalidHandle);
 
     // Cancel the thread's wait.
     thread->WaitCancel();