diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs index 82d7c7fa7..a090b6fa3 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs @@ -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)); diff --git a/Ryujinx.HLE/HOS/UserChannelPersistence.cs b/Ryujinx.HLE/HOS/UserChannelPersistence.cs index 62f28feef..13e7364f0 100644 --- a/Ryujinx.HLE/HOS/UserChannelPersistence.cs +++ b/Ryujinx.HLE/HOS/UserChannelPersistence.cs @@ -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;