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)
{
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)
{