Safety around ReadBytes

This commit is contained in:
Lee Fogg 2020-04-19 14:46:23 +01:00
parent a0ea8010df
commit 999e670ba1
1 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,9 @@ namespace Emux.GameBoy.Cartridge
public void ReadBytes(int address, byte[] buffer, int offset, int length)
{
if (memoryStream == null)
return;
memoryStream.Position = address;
memoryStream.Read(buffer, offset, length);
}