From 992ab77f1f89cf4b31f66fb51ed9572705fbe3df Mon Sep 17 00:00:00 2001 From: Ac_K Date: Mon, 21 Jun 2021 19:20:28 +0200 Subject: [PATCH] account: Fix wrong condition in TrySelectUserWithoutInteraction (#2384) * account: Fix wrong condition in TrySelectUserWithoutInteraction Since the implementation of User Profiles, we can get more than one profile stored. This PR fixes a wrong condition in `TrySelectUserWithoutInteraction`. Closes #2320 * Some cleanup --- .../HOS/Services/Account/Acc/ApplicationServiceServer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs index 794c72ce..aa687360 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs @@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc foreach (UserProfile userProfile in profiles) { - if (offset + 0x10 > (ulong)outputSize) + if (offset + 0x10 > outputSize) { break; } @@ -118,7 +118,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context) { - if (context.Device.System.AccountManager.GetUserCount() != 1) + if (context.Device.System.AccountManager.GetUserCount() < 1) { // Invalid UserId. UserId.Null.Write(context.ResponseData); @@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public ResultCode StoreSaveDataThumbnail(ServiceCtx context) { - ResultCode resultCode = CheckUserId(context, out UserId userId); + ResultCode resultCode = CheckUserId(context, out UserId _); if (resultCode != ResultCode.Success) { @@ -178,7 +178,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public ResultCode ClearSaveDataThumbnail(ServiceCtx context) { - ResultCode resultCode = CheckUserId(context, out UserId userId); + ResultCode resultCode = CheckUserId(context, out UserId _); if (resultCode != ResultCode.Success) {