Return "NotAvailable" when no UserChannel data is present. (#1569)

* Return "NotAvailable" when no UserChannel data is present.

* Return ObjectInvalid for undefined parameter kinds.

* No need to specify which, there's only one.

* Just works as a literal string.
This commit is contained in:
riperiperi 2020-09-23 22:57:18 +01:00 committed by GitHub
parent 840afabc22
commit e00ca92063
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -53,8 +53,16 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
// Only the first 0x18 bytes of the Data seems to be actually used.
storageData = StorageHelper.MakeLaunchParams(context.Device.System.State.Account.LastOpenedUser);
break;
case LaunchParameterKind.Unknown:
throw new NotImplementedException("Unknown LaunchParameterKind.");
default:
throw new NotImplementedException($"Unknown LaunchParameterKind {kind}");
return ResultCode.ObjectInvalid;
}
if (storageData == null)
{
return ResultCode.NotAvailable;
}
MakeObject(context, new AppletAE.IStorage(storageData));

View file

@ -31,7 +31,9 @@ namespace Ryujinx.HLE.HOS
public byte[] Pop()
{
return _userChannelStorages.Pop();
_userChannelStorages.TryPop(out byte[] result);
return result;
}
public bool IsEmpty => _userChannelStorages.Count == 0;