Просмотр исходного кода

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.
riperiperi 5 лет назад
Родитель
Сommit
e00ca92063

+ 9 - 1
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.
                     // Only the first 0x18 bytes of the Data seems to be actually used.
                     storageData = StorageHelper.MakeLaunchParams(context.Device.System.State.Account.LastOpenedUser);
                     storageData = StorageHelper.MakeLaunchParams(context.Device.System.State.Account.LastOpenedUser);
                     break;
                     break;
+                case LaunchParameterKind.Unknown:
+                    throw new NotImplementedException("Unknown LaunchParameterKind.");
+
                 default:
                 default:
-                    throw new NotImplementedException($"Unknown LaunchParameterKind {kind}");
+                    return ResultCode.ObjectInvalid;
+            }
+
+            if (storageData == null)
+            {
+                return ResultCode.NotAvailable;
             }
             }
 
 
             MakeObject(context, new AppletAE.IStorage(storageData));
             MakeObject(context, new AppletAE.IStorage(storageData));

+ 3 - 1
Ryujinx.HLE/HOS/UserChannelPersistence.cs

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