diff options
Diffstat (limited to 'Ryujinx.Horizon.Common')
| -rw-r--r-- | Ryujinx.Horizon.Common/Result.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Ryujinx.Horizon.Common/Result.cs b/Ryujinx.Horizon.Common/Result.cs index 04281199..ac843688 100644 --- a/Ryujinx.Horizon.Common/Result.cs +++ b/Ryujinx.Horizon.Common/Result.cs @@ -100,6 +100,14 @@ namespace Ryujinx.Horizon.Common } } + public void AbortOnFailureUnless(Result result, Result result2) + { + if (this != Success && this != result && this != result2) + { + ThrowInvalidResult(); + } + } + private void ThrowInvalidResult() { throw new InvalidResultException(this); @@ -115,4 +123,4 @@ namespace Ryujinx.Horizon.Common return PrintableResult; } } -} +}
\ No newline at end of file |
