1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-05 03:12:02 +00:00

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
This commit is contained in:
Ac_K 2021-06-21 19:20:28 +02:00 committed by GitHub
parent aca1c37d4b
commit 992ab77f1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
foreach (UserProfile userProfile in profiles) foreach (UserProfile userProfile in profiles)
{ {
if (offset + 0x10 > (ulong)outputSize) if (offset + 0x10 > outputSize)
{ {
break; break;
} }
@ -118,7 +118,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context) public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
{ {
if (context.Device.System.AccountManager.GetUserCount() != 1) if (context.Device.System.AccountManager.GetUserCount() < 1)
{ {
// Invalid UserId. // Invalid UserId.
UserId.Null.Write(context.ResponseData); UserId.Null.Write(context.ResponseData);
@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
public ResultCode StoreSaveDataThumbnail(ServiceCtx context) public ResultCode StoreSaveDataThumbnail(ServiceCtx context)
{ {
ResultCode resultCode = CheckUserId(context, out UserId userId); ResultCode resultCode = CheckUserId(context, out UserId _);
if (resultCode != ResultCode.Success) if (resultCode != ResultCode.Success)
{ {
@ -178,7 +178,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
public ResultCode ClearSaveDataThumbnail(ServiceCtx context) public ResultCode ClearSaveDataThumbnail(ServiceCtx context)
{ {
ResultCode resultCode = CheckUserId(context, out UserId userId); ResultCode resultCode = CheckUserId(context, out UserId _);
if (resultCode != ResultCode.Success) if (resultCode != ResultCode.Success)
{ {