From 0e1271c7c25b43e466c9e8dad38f4e3559948a88 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 21 Jun 2020 06:15:19 +1000 Subject: [PATCH] Fix exception creation --- .../Base Implementations/MemoryDomainStream.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainStream.cs b/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainStream.cs index 68ea50556f..44cf20dc3b 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainStream.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainStream.cs @@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Common public override int Read(byte[] buffer, int offset, int count) { if (offset < 0 || offset + count > buffer.Length) - throw new ArgumentOutOfRangeException("offset"); + throw new ArgumentException("start or end not within bounds of buffer", nameof(offset)); count = (int)Math.Min(count, Length - Position); if (count == 0) return 0; @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Common public override void Write(byte[] buffer, int offset, int count) { if (offset < 0 || offset + count > buffer.Length) - throw new ArgumentOutOfRangeException("offset"); + throw new ArgumentException("start or end not within bounds of buffer", nameof(offset)); for (var i = offset; i < offset + count; i++) _d.PokeByte(Position++, buffer[i]); }